Re: [xml] storing/printing subtree



2009/9/30 Marius Pacha <list matux de>:
Hi there,
I'm stuck with a problem for a couple of days now and hope to find help
here.
Parsing a xml document I'm in need of storing some of the subtrees inside of
it.
I was pointed toÂhttp://xmlsoft.org/html/libxml-xmlsave.html#xmlSaveTree
which looks good but unfortunately I wasn't able to solve my problem using
it. Also couldn't find any deeper docu or working example on the web. Here's
what I was trying:
xmlBuffer *bufÂ= xmlBufferCreate();
xmlSaveCtxt *subtree = xmlSaveToBuffer(buf,NULL,XML_SAVE_FORMAT);
int opResult = xmlSaveTree(subtree, cur);
I'm looking for something like ÂxmlDumpDocFormatMemory() Âonly for a subtree
starting at cur instead of the whole document.
Any help highly welcome.
Thanks for your time!
Regards,
marius

Have a look at xmlNodeDump, that's what we use in Perl bindings.

-- Petr



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