473,385 Members | 1,375 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

output encoding with perl XML::LibXML

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&#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 //
Aug 16 '05 #1
0 1106

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Vlajko Knezic | last post by:
Not so sure what is going on here but is something to do with the way UTF8 is handled in Perl and/or LibXML The sctript below: - accepts a value from a form text field; - ...
8
by: Dan | last post by:
Using XML::Simple in perl is extreemly slow to parse big XML files (can be up to 250M, taking ~1h). How can I increase my performance / reduce my memory usage? Is SAX the way forward?
1
by: John Bokma | last post by:
Hi, After some attempts using XSLT I am thinking about switching to Perl with a SAX (like?) parser. Which module(s) should I use? I see so many XML related modules at search.cpan.org that it...
2
by: Iain | last post by:
Folks, I'm having a problem with charset encodings that I desparately need some help with. I don't even pretend to know the basics about charsets, so please forgive my ignorance. I am...
13
by: Jesse Thompson | last post by:
Greetings fell XML folk. I've just gotten started making SAX filters in Perl. I was hoping to build an XML templating engine this way, but the performance of XML::SAX::Expat and XML::SAX::Writer...
5
by: bugbear | last post by:
I need to process some XML files that are rather large. However their structure may usefully be expressed as <ELEMENT FILE (RECORD)+> .. .. .. Each record is a few Kb. The files are many...
0
by: kellner | last post by:
Hello, I'm parsing a chunk of XML code and would like to add attribute values to individual tags if these are lacking. This is with perl 5.8.6, libxml2 2.6.17, XML::LibXML 1.58. Basically, I...
9
by: lnatz | last post by:
I need to parse a configuration file using xml. How do I retrieve the data between the elements? For example, if my configuration file was organized in the following manner: <configFile>...
1
by: saumalatha | last post by:
Someone please help me how to use xsl in perl. Currently i am using XML::LIBXML, is there any method to use xsl with this module. I am not ready to use any new modules.
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.