Re: [xml] How to omit the <?xml..?> header?



On Fri, Aug 28, 2009 at 12:43:22PM +0200, LAUN, Wolfgang wrote:
Currently I'm using xml_save_format_file_enc and
xml_doc_dump_memory_enc. But for a certain application I'd like to
write, either to stdout or into a memory buffer, a chunk of XML from a
document tree, but *without the <?xml?> header*. I have looked into
several API sections, and it seems that the only way to get XML text
without the header is to dump the tree to a memory buffer. Or is there
some way to set this option for the previously mentioned high-level
function?

  Use the xmlsave.h APIs and pass the XML_SAVE_NO_DECL option when
creating the saving context, that should do it. Note that it's dangerous
if you happen to save in an encoding different from UTF-8.

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel veillard com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/



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