将自定义xml文件导入到magento

将自定义xml文件导入到magento,xml,magento,Xml,Magento,我有一个包含在产品中的xml文件。 文件的结构如下: <?xml version="1.0" encoding="iso-8859-2"?> <service > <product id="2476" sku="SA 177-2" category="51" visible="1" > <title><![CDATA[Fedde Le Grand - OUTPUT]]></title> <

我有一个包含在产品中的xml文件。 文件的结构如下:

<?xml version="1.0" encoding="iso-8859-2"?>
  <service >
   <product id="2476" sku="SA 177-2" category="51" visible="1" >
     <title><![CDATA[Fedde Le Grand - OUTPUT]]></title>
     <short><![CDATA[Fedde Le Grand presents OUTPUT...]]</short>
     <long />
     <category><![CDATA[elektronika/dance/ambient]]></category>
     <price>1600</price>
     <vat>25</vat>
     <image>200909/92917a17f143088ce219_20090907.jpg</image>
     <actor><![CDATA[Fedde le Grand]]></actor>
     <album><![CDATA[Output]]></album>
     <label><![CDATA[CLS]]></label>
     <type><![CDATA[Audio CD]]></type>
   </product>
  </service>

1600
25
200909/92917a17f143088ce219_20090907.jpg
我想使用magento的导入系统,但它不起作用。我在配置文件操作XML中设置映射。此文件的结构:

<action type="dataflow/convert_parser_xml_excel" method="parse">
    <var name="single_sheet"><![CDATA[]]></var>
    <var name="fieldnames"></var>
    <var name="map">
        <map name="product_category"><![CDATA[category_ids]]></map>
        <map name="product_sku"><![CDATA[sku]]></map>
        <map name="title"><![CDATA[name]]></map>
        <map name="short"><![CDATA[short_description]]></map>
        <map name="long"><![CDATA[description]]></map>
        <map name="price"><![CDATA[price]]></map>
        <map name="vat"><![CDATA[tax_class_id]]></map>
        <map name="image"><![CDATA[image]]></map>
        <map name="actor"><![CDATA[meta_description]]></map>
        <map name="album"><![CDATA[meta_title]]></map>
        <map name="label"><![CDATA[meta_keyword]]></map>
        <map name="type"><![CDATA[samples_title]]></map>
    </var>
    <var name="store"><![CDATA[0]]></var>
    <var name="number_of_records">1</var>
    <var name="decimal_separator"><![CDATA[.]]></var>
    <var name="adapter">catalog/convert_adapter_product</var>
    <var name="method">parse</var>
</action>

1.
目录/转换适配器产品
作语法分析
.结果发现0行,因此失败。有人能帮我吗?我不明白这个问题。
您好,罗兰·德森伊

您必须编写自己的解析器类,然后使用高级概要文件。convert_解析器_xml_excel需要excel xml格式的文件。 如果查看Mage_Dataflow_Model_Convert_Parser_Xml_Excel::parse()函数,您会发现它需要的Xml格式与您的不同

//excerpt from Mage_Dataflow_Model_Convert_Parser_Xml_Excel::parse()
    $worksheet = $this->getVar('single_sheet', '');

            $xmlString = $xmlRowString = '';
            $countRows = 0;
            $isWorksheet = $isRow = false;
            while (($xmlOriginalString = $batchIoAdapter->read()) !== false) {
                $xmlString .= $xmlOriginalString;
                if (!$isWorksheet) {
                    $strposS = strpos($xmlString, '<Worksheet');
                    $substrL = 10;
                    //fix for OpenOffice
                    if ($strposS === false) {
                        $strposS = strpos($xmlString, '<ss:Worksheet');
                        $substrL = 13;
                    }
//摘录自Mage\u数据流\u模型\u转换\u解析器\u Xml\u Excel::parse()
$worksheet=$this->getVar('single_sheet','');
$xmlString=$xmlRowString='';
$countRows=0;
$isWorksheet=$isRow=false;
而($xmlOriginalString=$batchIoAdapter->read())!==false){
$xmlString.=$xmlOriginalString;
如果(!$isWorksheet){

$strpos=strpos($xmlString,’你能提供更多的信息吗?