On Tue, May 14, 2002 at 09:55:28PM -0700, Daisuke Maki wrote:
> Hmm, there seems to be a serious bug in XML::LibXML 1.49...
> 
>    use XML::LibXML;
>    my $parser = XML::LibXML->new();
>    my $doc    = $parser->parse_string( <<EOM );
>    <foo>
>       bar
>    </foo>
>    EOM
> 
>    foreach my $node ( $doc->findnodes( '/foo' ) ) {
>       print "# toString: ", $node->toString, "\n";
>       print "# getData: ", $node->getData, "\n";
>    }
> 
> Above code produces:
> 
>    # toString: <foo>
>       bar
>    </foo>
>    # getData:
> 
> I tried this with XML::LibXML 1.40, and it correctly produces:
> 
>    # toString: <foo>
>       bar
>    </foo>
>    # getData:
>       bar

actually this was a bug in XML::LibXML 1.40
the spec says that elements have - of course - no nodeValue. XML::LibXML 1.49
does this now correctly. 

for your problem to recieve text content of a subtree use $node->textContent.
this function is introduced with DOM Level 3 and i think it will not 
be changed in future versions of the spec. 

mainly this is a documentation bug which i fixed in CVS. 

christian


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to