Re: libxml2 in gnome 1.4



On Sat, Mar 24, 2001 at 01:17:18AM +0100, ERDI Gergo wrote:
> Could we see some solid code please?
> Something _very_ general:
> 	1, I have an xmlNodePtr, how do I fill a gchar* with its
> content/the value of one of its properties?
> 	2, I have a gchar* that I know nothing about, how do I save it as
> the content/the value of one of the properties of an xmlNodePtr?
> 
> I think this would really make the transition easy.

  Tell me in what encoding a gchar is. I can tell you that libxml
uses xmlChar for this precise reason, it is an unsigned char (a byte)
and xmlChar * are supposed to be 0 terminated and encoded in UTF8.
(if you run a pedantic parser it will tell you places where C strings
are assigned to xmlChar * and you can check that the cast makes sense).

  If you tell me what is the encoding used in a gchar * then doing
the conversions functions back and forth are close to trivial and
I will provide them ! Do you all expect ISO-Latin-1, or is there
different encodings depending on other settings ?

Daniel

-- 
Daniel Veillard      | Red Hat Network http://redhat.com/products/network/
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]