output encoding with perl XML::LibXML

N

nicolas

Hello,

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é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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top