reopen 231833 thanks On Su,n 30 Dec 2007 20:43:26 +0200, Niko Tyni writes: >> see included script: findvalue interprets CDATA properly, >> findnodes_as_string doesn't - see last line of output, where the >> opening "<" around hallo is quoted (wrongly) and the closing ">" ain't. > >> findvalue: sdlfkkskdfjl >> cdata grind <hallo> sdsdfsdf >> findnodes: sdlfkkskdfjl >> cdata grind <hallo> sdsdfsdf > >Hi Alexander, > >while I admit I'm not very familiar with XPath, I believe this is >not a bug, but rather the intended behaviour.
it's not an xpath-specific issue but rather a violation of the CDATA specs. >The documentation of XML::XPath::findnodes_as_string states it "returns >the nodes found reproduced as XML", and the W3C XML Path Language >specification section 5.7, "Text Nodes" [1] contains this: > > NOTE: When a text node that contains a < character is written out > as XML, the < character must be escaped by, for example, using <, > or including it in a CDATA section. you do realize that last part of the sentence talks about including it in a CDATA section and thus voids your argument? the example i gave indeed does use CDATA to avoid any mangling of the content, but findnodes_as_string mangles even CDATA which it must not do. as per the xml specs http://www.w3.org/TR/1998/REC-xml-19980210#sec-cdata-sect CDATA is sacrosanct and nothing within it can be escaped, ever: Within a CDATA section, only the CDEnd string is recognized as markup, so that left angle brackets and ampersands may occur in their literal form; they need not (and cannot) be escaped using "<" and "&". >I'm thus closing the bug. Please reply/reopen if you disagree. i hereby do :-) regards az -- + Alexander Zangerl + DSA 42BD645D + (RSA 5B586291) Ahhh...I see the fuck-up fairy has visited us again... -- Nigel Williams
signature.asc
Description: Digital Signature

