Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have an xml feed that looks like this:
-
-
STOMP is explosive, provocative, sophisticated, sexy, utterly unique and appeals to audiences of all ages.
]]>
I use this description/text() and I get nothing. Please help me.
FYI this module is fantastic.
Comments
Comment #1
twistor CreditAttribution: twistor commentedI can verify that this in a bug in the way SimpleXML handles things. The dev version now uses the DOM directly. It grabs CDATA just fine. Love for you to test it out.
Comment #2
bentekwork CreditAttribution: bentekwork commentedI ended up using the feeds tamper and used strpos() to get rid of all the cdata stuff. Pretty hackish but it solved my problem.
I will test the dev version now and see if I can get rid of my hack, thanks for your help!
Comment #3
ghazlewood CreditAttribution: ghazlewood commentedJust got caught out by this with the 7.x-1.0-beta2 version but can confirm that 7.x-1.x-dev correctly returns CDATA with the text() function. Thanks for the great work on this, thought I was going to need to write something to handle MRSS with feeds but using feeds_xpathparser I have everything working nicely.
Comment #5
arpieb CreditAttribution: arpieb commentedI'm running into the same problem on a D6.20 installation with the latest 6.x-1.x-dev code as of today. The URL of the RSS feed I'm pulling from is:
http://t.cdc.gov/feed.aspx?topicid=27132&fmt=rss2&fromdate=2010-01-01&ic...
My XPathParser settings are as follows:
Context: /rss/channel/item
title: .//title
body: .//ContentItem/content|ContentBody
created: .//a10|updated
url: .//link
guid: .//guid
I implemented hook_feeds_after_parse so I could see what is being parsed out, and am getting the following:
Any idea why I'm getting an empty body text (description item in the batch->items[X] arrays) returned?
Thanks!
Comment #6
twistor CreditAttribution: twistor commented@arpieb, thank you for the detailed post. This, however, is another issue entirely. I'm reopening an issue for that, it's a big one.