Closed (works as designed)
Project:
Feeds XPath Parser
Version:
7.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
15 Feb 2012 at 08:43 UTC
Updated:
16 Apr 2013 at 10:48 UTC
Jump to comment: Most recent file
Comments
Comment #1
emptyvoid commentedI believe this is by design. The CDATA wrapper tells the parser to not validate the content within it. It is treated as "RAW" content. This could include binary content hex coded, or rather hackish HTML, XML, SGML, anything really. So if you want to "parse" the content within the CDATA node I would suggest extracting the contents then run it through another instance of the parser.
Comment #2
Magicthought commentedhow do you do that with xpath parser?
I can extract all the CDATA content with a query, is there a way to run a query over that result?
I've tried using the $temp provided variable but no luck; any tips?
Comment #3
ndobromirov commentedThis can be done with the removal of the CDATA from the raw HTML data before parsing, but it is not safe.
Attaching a simple patch, that solves the issue.
It is an option to add a configuration checkbox that enables the new behavior (default value will be unchecked) in the parser settings page.
Comment #4
twistor commentedThis is definitely by design. We cannot, and will not be able to parse inside CDATA.
See #1459870: Add XPath query Feeds Tamper plugin. for an alternative.
Comment #5
ndobromirov commentedIn a more generic way, there could be added a hook before the parsing.
It will be able to alter the raw data that will go into the parser.
For example it could apply an XSLT, but this is probably for a separate issue.