Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > output encoding with perl XML::LibXML

Thread Tools

output encoding with perl XML::LibXML

Posts: n/a

I hesitated a lot before posting this topic here, but it seems more appropriate
than posting it in c.l.perl.

I would like to know how to change output encoding when using the
perl wrapper for LibXML, i. e. XML::LibXML. I have searched the documentation
and the web but cannot find any solution:

Whenever I make a DOM access to a document and serialize a node to a string, it
is returned as if no encoding was given for the doc; therefore, no character
entity is resolved, which is not what I want.

e. g., once parsed, <note id="_2852" id-ref="_2851">pléonastique</note>
returns <note id="_2852" id-ref="_2851">pl&#xE9;onastique</note>

I tried to change the document encoding by playing with the "setEncoding" method
of the "Document" object. This works for Document object, but not for any node
that would be extracted from it with a DOM access method.

I would be pleased if anyone could help.

nicolas //
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading Text File Encoding and converting to Perls internal UTF-8 encoding Perl Misc 2 04-17-2009 11:22 PM
Unicode/UTF-8 Encoding and ASP.NET Output =?Utf-8?B?QWxleCBNYWdoZW4=?= ASP .Net 2 05-23-2006 03:08 AM
changing JVM encoding; setting -Dfile.encoding doesn't work Java 1 10-08-2004 09:50 PM
Encoding.Default and Encoding.UTF8 Hardy Wang ASP .Net 5 06-09-2004 04:04 PM
XSL output and/or encoding question.. Beowulf XML 3 10-29-2003 06:25 PM