Your message dated Sun, 30 Dec 2007 20:43:26 +0200
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 <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, Feb 09, 2004 at 03:36:39PM +1000, Alexander Zangerl wrote:
> 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.
> 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.
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.
I'm thus closing the bug. Please reply/reopen if you disagree.
[1] http://www.w3.org/TR/xpath#section-Text-Nodes
Cheers,
--
Niko Tyni [EMAIL PROTECTED]
--- End Message ---