Re: [xml] xmlReadMemory limitation




I have tried this, but the result i 4 bytes. Looks like the size of the adress.


/Espen
MSN: espene halden net



Daniel Veillard <veillard redhat com>

11.03.2005 10:40
Please respond to veillard

       
        To:        Espen Ekeroth <espen ekeroth omxgroup com>
        cc:        xml gnome org
        Subject:        Re: [xml] xmlReadMemory limitation



On Fri, Mar 11, 2005 at 10:31:03AM +0100, Espen Ekeroth wrote:
> Could it be my use of the function: It looks like this:
[...]
>     doc = xmlReadMemory(a_node->content, 400000, "noname.xml", NULL, 0);
[...]
> The reason for using it like this is that the xml is recevied through the
> csoap library from a JBoss webservice.
>
> I have tried to do it useing "sizeof(a_node->content)" but for some reason
> I only get 4 as the size (looks like the size of the adress.  [I have also
> tried to get the content first using the xmlNodeGetContent() function, but
> the result was the same]

you must pass the length of the string buffer. You know that a_node->content
is an UTF-8 string so you can use strlen() to extract the size and pass it
down.
 doc = xmlReadMemory(a_node->content, strlen(a_node->content),
                     "noname.xml", NULL, 0);

Daniel

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



********************************************************************************
This e-mail and the information it contains may be privileged and/or
confidential. It is for the intended addressee(s) only.
The unauthorised use, disclosure or copying of this e-mail, or any information it contains, is prohibited.
If you are not an intended recipient, please contact the sender and delete the material from your computer.
********************************************************************************


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