Re: [xml] xmlNodeListGetString question

On Thu, Nov 14, 2002 at 04:16:38PM -0000, spinmar interfree it wrote:


I have a question about xmlNodeListGetString. This function is used
to get the content of a node and it returns a xmlChar*. Well if  i parse
a latin1 xml, the content is latin ( and then with èòàù....): I suppose
taht when I take the content of an element, libxml2 turn it into utf8.


So if I have to add this content in another latin1 file (I'm building
a latin1 xml taking informations from different sources), I haven't to
convert this content with isolat1ToUTF8 before adding it: is it true? Can
I do immediatly xmlNewChild(......, content)?

 yes, if you're putting back the information into another XML document
it had been converted to UTF8 at creation (or if you created it from piece,
you must make sure all the pieces are UTF8).

At the end I'll trasform the content into a char* with xmlDocDumpMemoryEnc with ISO-8859-1 encoding and use 
it with xalan.
Do you see it any problems?



Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]