Hi there, hoping someone can offer some assistance.

I have created an XML feed which I am trying to map correctly onto content items in another website.

The content of the XML looks like this:

<?xml version="1.0" encoding="UTF-8" ?><xml>
  <node>
    <field_manufacturer_value>Holden</field_manufacturer_value>
    <title>VK Commodore</title>
    <field_price_value>$12,990</field_price_value>
    <field_transmission_value>Automatic</field_transmission_value>
    <body>&lt;p&gt;This is a great car.&lt;/p&gt;</body>
  </node>
  <node>
    <field_manufacturer_value>Ford</field_manufacturer_value>
    <title>Falcon XF</title>
    <field_price_value>$21,990</field_price_value>
    <field_transmission_value>Tiptronic</field_transmission_value>
    <body>&lt;p&gt;This is a great car as well.&lt;/p&gt;</body>
  </node>
  <node>
    <field_manufacturer_value>Bugatti</field_manufacturer_value>
    <title>Veyron</title>
    <field_price_value>$1,000,000</field_price_value>
    <field_transmission_value>Other</field_transmission_value>
    <body>&lt;p&gt;This is also a great car.&lt;/p&gt;</body>
  </node>
</xml>

However when I try to map the fields using the mapper (parsing with the Common Syndication Parser in PHP5), this is the 'example' output I see:

Array
(
    [title] => VK Commodore
    [description] => 
      Manufacturer: 
           
                    Holden        

      Price: 
          
                    $12,990        
        
      Transmission: 
    
      ...
    [options] => Array
        (
            [original_author] => 
            [timestamp] => 1249966653
            [original_url] => http://*snip*/drupal/613/?q=node/3
            [guid] => 3 at http://*snip*/drupal/613
            [domains] => 
            [tags] => 
        )

)

All the CCK fields are being combined into this 'desciption' element. Am I missing something obvious? I have tried both with an XML and standard RSS display type from views, same result. How can I ensure the fields are all retained when the feed is parsed?

Thanks in advance for any advice!

Comments

DrPhunk’s picture

Update: This appears to be happening on all my feed types (inluding CSV files). Nothing seems to be parsing correctly so it might be an issue with FeedAPI instead.

alex_b’s picture

Project: Feed Element Mapper » FeedAPI
Version: 6.x-1.0 » 6.x-1.x-dev

This is a parser issue. You are using an RSS/Atom parser for parsing a non RSS/Atom XML feed. One solution could be to write your own parser tailored to your specific needs.

This is an XPath based parser I've whipped up recently for a project, it may be exactly what you are looking for: http://devseed.browse.cvsdude.com/sandbox/drupal-6/rparser

DrPhunk’s picture

Thanks for the help, much appreciated - though your link is requesting a username / password to access :)