Your message dated Tue, 01 Jan 2008 17:03:31 +1000
with message-id <[EMAIL PROTECTED]>
and subject line Bug#231833: libxml-xpath-perl: CDATA handling is broken 
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: libxml-xpath-perl
Version: 1.11-1
Severity: normal

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.

regards
az

--
#!/usr/bin/perl
use XML::XPath;
my $xp = XML::XPath->new(xml => q|<test>
   <rumsti>sdlfkkskdfjl 
<![CDATA[cdata grind <hallo> sdsdfsdf]]></rumsti>
</test>
|);
print "findvalue: ". $xp->findvalue ('/test/rumsti/text()') ."\n";
print "findnodes: ".$xp->findnodes_as_string("/test/rumsti/text()")."\n";
--

[az:~] perl ./x
findvalue: sdlfkkskdfjl 
cdata grind <hallo> sdsdfsdf
findnodes: sdlfkkskdfjl 
cdata grind &lt;hallo> sdsdfsdf


-- System Information
Debian Release: 3.0
Architecture: i386
Kernel: Linux cluon 2.4.24 #1 Tue Jan 6 12:42:45 EST 2004 i686
Locale: LANG=C, LC_CTYPE=de_AT

Versions of packages libxml-xpath-perl depends on:
ii  libxml-parser-perl            2.31-1     Perl module for parsing XML files
ii  perl                          5.6.1-8.6  Larry Wall's Practical Extraction 



--- End Message ---
--- Begin Message ---
On Mon, 31 Dec 2007 14:24:55 +0200, Niko Tyni writes:
>Hm, so would you expect the findnodes_as_string() return value in your
>example include the CDATA markup then?
>
>sdlfkkskdfjl 
><![CDATA[cdata grind <hallo> sdsdfsdf]]

yes, i would have expected that, but see below.

>As I understand this, that's the other option available. In particular,
>returning unquoted text like findvalue() does would not be "reproducing
>the node as XML." 

indeed, findvalue produces only one value, thus does not have to deal
with node boundaries and so < and & are not needed as special chars.

further research of this issue has given me this discussion 
<URL:http://www.perlmonks.org/?node_id=170286>
of a similar complaint, where matt seargent states that this behaviour
is his design choice: it's either creating cdata (like i would have 
preferred, retaining more information from the original) or &lt; escaping
which he chose. 
in short, xml::xpath can't preserve cdata and one needs
to use some other xml engine if such is required.

niko, on re-reading of the xpath standard i conclude that you we right 
to close the bug, sorry. 

(i still think that sgml/xml quoting is fundamentally and horribly broken.)

regards
az


-- 
+ Alexander Zangerl + DSA 42BD645D + (RSA 5B586291)
The social dynamics of the net are a direct consequence of the fact
that nobody has yet developed a Remote Strangulation Protocol. 
 -- Larry Wall

Attachment: signature.asc
Description: Digital Signature


--- End Message ---

Reply via email to