Skip Menu | will be shut down on March 1st, 2021.

This queue is for tickets about the XML-LibXML CPAN distribution.

Report information
The Basics
Id: 254
Status: resolved
Priority: 0/
Queue: XML-LibXML

Owner: Nobody in particular
Requestors: merijnb [...]

Bug Information
Severity: Normal
Broken in: 1.31
Fixed in: (no value)

Subject: appendTextNode not working on $elem=XML::LibXML::Element->new("bar");
Download (untitled) / with headers
text/plain 1.2k
With XML-LibXML 1.31 on perl 5.6.1, Solaris 2.7 the following looks very strange to me: use XML::LibXML; use Data::Dumper; my $elem1 = XML::LibXML::Element->new("bar"); my $vers='1.0'; my $enc= 'utf8'; my $dom = XML::LibXML::Document->createDocument( $vers, $enc ); my $elem2 = $dom->createElement('bar' ); add_and_display($elem1); add_and_display($elem2); sub add_and_display { my ($element) = @_; $element->setAttribute("color" => "blotchy purply"); $element->appendTextChild('foo', "test test test."); $element->appendTextNode("test test test "); $element->appendText("test test test"); print $element->toString() . "\n";; print "$element\n"; print Dumper($element); } gives as output : <bar color="blotchy purply"><foo>test test test.</foo></bar> XML::LibXML::Element=SCALAR(0x11c07c) $VAR1 = bless( do{\(my $o = 2052528)}, 'XML::LibXML::Element' ); <bar color="blotchy purply"><foo>test test test.</foo>test test test test test test</bar> XML::LibXML::Element=SCALAR(0x1fbe78) $VAR1 = bless( do{\(my $o = 2052568)}, 'XML::LibXML::Element' ); When the element is created as a XML::LibXML::Element-new, the appendText does not work. If it is created with $dom->createElement, it does. Is this expected, I cannot find this behaviour in the docs.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to