Re: [xml] extracting xml subtree text (string) for entire subtree of XML node

On Thu, Jun 22, 2006 at 10:31:05AM -0700, Andric, Milan wrote:
I have xmlNodePtr pointing to a particular xmlNode in a DOM tree. 
I'm looking for a way to get full XML text representation of a XML
subtree from that point on - i.e. XML string representing subtree for
which currently pointed node is a root. 
I was looking at xmlSave function, but I'm not sure how would such help
obtain XML string representation of entire subtree... an example would
be helpful. 

  1/ make a buffer with xmlBufferCreate
  2/ make a save context to save to that buffer with xmlSaveToBuffer
  3/ as already explained use xmlSaveTree to save to the context 
     the result will be in the buffer in teh encoding indicated in 2/
     and with the options passed there too

Daniel Veillard      | Red Hat
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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