output encoding with perl XML::LibXML

Discussion in 'XML' started by nicolas, Aug 16, 2005.

  1. nicolas

    nicolas Guest

    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.



    --
    nicolas //
     
    nicolas, Aug 16, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ian Gregory
    Replies:
    1
    Views:
    514
  2. Iain
    Replies:
    2
    Views:
    681
  3. Olav
    Replies:
    3
    Views:
    4,287
  4. kellner
    Replies:
    0
    Views:
    881
    kellner
    Jul 23, 2006
  5. Iain
    Replies:
    1
    Views:
    156
    Martin Honnen
    Dec 15, 2003
Loading...

Share This Page