Re: [xml] xmlNodeListGetString question



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

Hi,

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.

  yes

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?

  no.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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