Re: [xml] "Write" equivalent to xmlReadMemory?



Thomas ,

Rush is right u can use xmlDocDumpMemory() or if u want 
some formatting u can go for the equivalent xmlDocDumpFormatMemory().

Once u get the memory equivalent for this in xmlChar Buffer & the buffer
size u can pass both of them to xmlParseMemory() API to get the
xmlDocPtr.
With xmlDocPtr at ur disposal u can then append/update/remove  nodes &
attribs name/values to the in-memory XML tree & later on save the same
back to memory using xmlDocDump/(Format)Memory().

U can check out my earlier post 
        http://mail.gnome.org/archives/xml/2008-June/msg00042.html
for its usage.


---- Lav

-----Original Message-----
From: xml-bounces gnome org [mailto:xml-bounces gnome org] On Behalf Of
Thomas Hauk
Sent: Saturday, June 28, 2008 2:49 AM
To: xml gnome org
Subject: [xml] "Write" equivalent to xmlReadMemory?

Hello all,

I'm doing some quick research to determine if libxml2 is appropriate  
for our use on an embedded device. We want to parse XML documents  
which are already in memory (present in a file system that saves files  
into flash memory) and also write them back to memory (we already have  
an area of flash set aside as a buffer for when writing files to the  
device I can use).

I noticed there is xmlReadMemory. Is there also some xmlWriteMemory  
equivalent? I can't find it in the documentation, nor by searching  
this mailing list's archives.

Also, I know libxml2 does dynamic memory allocation, which isn't  
possible on our device, but I already have a plan to implement a small  
"allocator", whose name I can swap into the line of "xmlMallocFunc  
xmlMallocAtomic = (xmlMallocFunc) malloc;" in place of malloc, but is  
there an easier way to do this?

Cheers,

T

--
"It's a very sobering feeling to be up in space and realise that one's  
safety factor was determined by the lowest bidder on a government  
contract.''
-- Alan Shepherd

_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xml gnome org
http://mail.gnome.org/mailman/listinfo/xml


DISCLAIMER:
This email may contain confidential or privileged information for the intended recipient(s) and the views 
expressed in the same are not necessarily the views of Zensar Technologies Ltd. If you are not the intended 
recipient or have received this e-mail by error, its use is strictly prohibited, please delete the e-mail and 
notify the sender. Zensar Technologies Ltd. does not accept any liability for virus infected mails. 



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