RE: LibXML: How do I serialize an attribute like this Attr="{" to file
by other posts by this author
Jan 19 2004 9:31AM messages near this date
view in the new Beta List Site
Re: LibXML: How do I serialize an attribute like this Attr="{" to file
|
Re: LibXML: How do I serialize an attribute like this Attr="{"
to file
My example is as below
------------------------------
use XML::LibXML;
my $parser = XML::LibXML-> new();
my $doc = $parser-> parse_string(<<EOF);
<A> <AA Attr="B">xxx</AA></A>
EOF
@AA=$doc-> getDocumentElement()->getElementsByTagName("AA");
$AA[0]-> setAttribute("Attr","{");
$doc-> toFile("a.xml");
------------------------------
open a.xml you'll see <AA Attr="&#123;">
-----Original Message-----
From: Petr Pajas [mailto:pajas@[...].cz]
Sent: Thursday, January 08, 2004 10:58 PM
To: Derek Chen (RD-TW)
Cc: perl-xml@[...].com
Subject: Re: LibXML: How do I serialize an attribute like this Attr="{" to file
<Derek_Chen@[...].tw> writes:
> Hi,
> I want my xml file having an element like this <abc
> Attr="{"/>. But when I call $doc->toFile it becomes <abc
> Attr="&#123;">. What should I do? Thanks.
>
> Derek
Hm, I check with various setups, including the latest one using CVS
versions of libxml2 and XML-LibXML and I cannot reproduce the problem.
Please specify your libraries versions and send a functional
reproducible example code demonstrating the behaviour you describe and
XML file to test it with.
-- Petr
_______________________________________________
Perl-XML mailing list
Perl-XML@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Petr Pajas
|