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

twistor’s picture

Version: 6.x-1.9 » 6.x-1.x-dev
Component: User interface » Code
Assigned: Unassigned » twistor
Category: support » bug
Status: Active » Fixed

I 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.

bentekwork’s picture

I 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!

ghazlewood’s picture

Just 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.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

arpieb’s picture

Status: Closed (fixed) » Active

I'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:

FeedsSource Object
(
    [feed_nid:protected] => 92
    [importer:protected] => FeedsImporter Object
        (
            [fetcher:protected] => FeedsHTTPFetcher Object
                (
                    [config:protected] => Array
                        (
                            [auto_detect_feeds] => 
                            [use_pubsubhubbub] => 
                            [designated_hub] => 
                        )

                    [id:protected] => feed
                    [export_type:protected] => 0
                    [disabled:protected] => 
                    [source_config] => Array
                        (
                            [source] => 
                        )

                )

            [parser:protected] => FeedsSyndicationParser Object
                (
                    [config:protected] => Array
                        (
                        )

                    [id:protected] => feed
                    [export_type:protected] => 0
                    [disabled:protected] => 
                    [source_config] => Array
                        (
                        )

                )

            [processor:protected] => FeedsNodeProcessor Object
                (
                    [config:protected] => Array
                        (
                            [content_type] => feed_item
                            [update_existing] => 0
                            [expire] => -1
                            [mappings] => Array
                                (
                                    [0] => Array
                                        (
                                            [source] => title
                                            [target] => title
                                            [unique] => 
                                        )

                                    [1] => Array
                                        (
                                            [source] => description
                                            [target] => body
                                            [unique] => 
                                        )

                                    [2] => Array
                                        (
                                            [source] => timestamp
                                            [target] => created
                                            [unique] => 
                                        )

                                    [3] => Array
                                        (
                                            [source] => url
                                            [target] => url
                                            [unique] => 1
                                        )

                                    [4] => Array
                                        (
                                            [source] => guid
                                            [target] => guid
                                            [unique] => 1
                                        )

                                )

                            [input_format] => 0
                            [author] => 0
                        )

                    [id:protected] => feed
                    [export_type:protected] => 0
                    [disabled:protected] => 
                    [source_config] => Array
                        (
                        )

                )

            [plugin_types:protected] => Array
                (
                    [0] => fetcher
                    [1] => parser
                    [2] => processor
                )

            [config:protected] => Array
                (
                    [name] => Feed
                    [description] => Import RSS or Atom feeds, create nodes from feed items.
                    [fetcher] => Array
                        (
                            [plugin_key] => FeedsHTTPFetcher
                            [config] => Array
                                (
                                    [auto_detect_feeds] => 
                                    [use_pubsubhubbub] => 
                                    [designated_hub] => 
                                )

                        )

                    [parser] => Array
                        (
                            [plugin_key] => FeedsSyndicationParser
                            [config] => Array
                                (
                                )

                        )

                    [processor] => Array
                        (
                            [plugin_key] => FeedsNodeProcessor
                            [config] => Array
                                (
                                    [content_type] => feed_item
                                    [update_existing] => 0
                                    [expire] => -1
                                    [mappings] => Array
                                        (
                                            [0] => Array
                                                (
                                                    [source] => title
                                                    [target] => title
                                                    [unique] => 
                                                )

                                            [1] => Array
                                                (
                                                    [source] => description
                                                    [target] => body
                                                    [unique] => 
                                                )

                                            [2] => Array
                                                (
                                                    [source] => timestamp
                                                    [target] => created
                                                    [unique] => 
                                                )

                                            [3] => Array
                                                (
                                                    [source] => url
                                                    [target] => url
                                                    [unique] => 1
                                                )

                                            [4] => Array
                                                (
                                                    [source] => guid
                                                    [target] => guid
                                                    [unique] => 1
                                                )

                                        )

                                    [input_format] => 0
                                    [author] => 0
                                )

                        )

                    [content_type] => feed
                    [update] => 0
                    [import_period] => 1800
                    [expire_period] => 3600
                    [import_on_create] => 1
                )

            [id:protected] => feed
            [export_type:protected] => 2
            [disabled:protected] => 
        )

    [batch:protected] => FeedsHTTPBatch Object
        (
            [url:protected] => http://t.cdc.gov/feed.aspx?topicid=27132&fmt=rss2&fromdate=2010-01-01&ic=true
            [file_path:protected] => 
            [current_item:protected] => 
            [raw:protected] => 
            [title] => Centers for Disease Control and Prevention
            [description] => The Centers for Disease Control and Prevention's (CDC) Web Content Syndication service that allows partners including federal public health agencies, state and local public health departments, non-profit organizations, academic institutions, and commercial organizations to syndicate CDC content directly to their sites. Public health partners can gain direct access to CDC Web content without having to monitor and copy updates, control which content from CDC.gov to use on their site, and integrate CDC content with localized content while keeping visitors on their sites. This is a free service provided by the CDC.
            [link] => http://www.cdc.gov/
            [items] => Array
                (
                    [0] => Array
                        (
                            [title] => Pilot Projects - Injections Safety
                            [description] => 
                            [author_name] => 
                            [timestamp] => 1306865667
                            [url] => http://t.cdc.gov/IKU
                            [guid] => 056cc928-cc46-4a92-a115-095de2edf182
                            [geolocations] => Array
                                (
                                )

                            [domains] => Array
                                (
                                )

                            [tags] => Array
                                (
                                )

                        )

                    [1] => Array
                        (
                            [title] => Recent Meetings - Injections Safety
                            [description] => 
                            [author_name] => 
                            [timestamp] => 1306865667
                            [url] => http://t.cdc.gov/IKT
                            [guid] => 0f2ef93c-d7be-42c7-ba18-64ba57579c5f
                            [geolocations] => Array
                                (
                                )

                            [domains] => Array
                                (
                                )

                            [tags] => Array
                                (
                                )

                        )

                    [2] => Array
                        (
                            [title] => Recent Publications - Injections Safety
                            [description] => 
                            [author_name] => 
                            [timestamp] => 1306865667
                            [url] => http://t.cdc.gov/IKS
                            [guid] => 09421e21-30c9-4980-b1c4-84b9d06fd54e
                            [geolocations] => Array
                                (
                                )

                            [domains] => Array
                                (
                                )

                            [tags] => Array
                                (
                                )

                        )

                    [3] => Array
                        (
                            [title] => Safe Injection Practices - Injections Safety
                            [description] => 
                            [author_name] => 
                            [timestamp] => 1306865667
                            [url] => http://t.cdc.gov/IKR
                            [guid] => 31d0f676-1daf-4631-b46a-d0e2b557249c
                            [geolocations] => Array
                                (
                                )

                            [domains] => Array
                                (
                                )

                            [tags] => Array
                                (
                                )

                        )

                    [4] => Array
                        (
                            [title] => Preventing Unsafe Injection Practices - Injection Safety
                            [description] => 
                            [author_name] => 
                            [timestamp] => 1306865667
                            [url] => http://t.cdc.gov/IKQ
                            [guid] => 14a34440-b0b3-458f-9156-46494e5125cf
                            [geolocations] => Array
                                (
                                )

                            [domains] => Array
                                (
                                )

                            [tags] => Array
                                (
                                )

                        )

                    [5] => Array
                        (
                            [title] => Information for Patients - Injection Safety
                            [description] => 
                            [author_name] => 
                            [timestamp] => 1306865667
                            [url] => http://t.cdc.gov/IKP
                            [guid] => 13018804-5cd6-4fc5-aec6-23c324047876
                            [geolocations] => Array
                                (
                                )

                            [domains] => Array
                                (
                                )

                            [tags] => Array
                                (
                                )

                        )

                    [6] => Array
                        (
                            [title] => Information for Providers - Injection Safety
                            [description] => 
                            [author_name] => 
                            [timestamp] => 1306865667
                            [url] => http://t.cdc.gov/IKO
                            [guid] => 18f0333b-4670-4229-98c5-ae8bf0d23585
                            [geolocations] => Array
                                (
                                )

                            [domains] => Array
                                (
                                )

                            [tags] => Array
                                (
                                )

                        )

                )

            [feed_nid] => 92
            [created] => 0
            [updated] => 0
            [total:protected] => Array
                (
                )

            [progress:protected] => Array
                (
                    [fetching] => 1
                    [parsing] => 1
                    [processing] => 1
                )

        )

    [config:protected] => Array
        (
            [FeedsHTTPFetcher] => Array
                (
                    [source] => http://t.cdc.gov/feed.aspx?topicid=27132&fmt=rss2&fromdate=2010-01-01&ic=true
                )

        )

    [id:protected] => feed
    [export_type:protected] => 1
    [disabled:protected] => 
)

Any idea why I'm getting an empty body text (description item in the batch->items[X] arrays) returned?

Thanks!

twistor’s picture

Status: Active » Fixed

@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.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.