ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-xml
perl-xml
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","&#123;");
$doc-> toFile("a.xml");
------------------------------
open a.xml you'll see <AA Attr="&amp;#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="&#123;" to file


<Derek_Chen@[...].tw>  writes:

>  Hi,

>  I want my xml file having an element like this <abc
>  Attr="&#123;"/>. But when I call $doc->toFile it becomes <abc
>  Attr="&amp;#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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved