List Info

Thread: extracting xml subtree text (string) for entire subtree of XML node




extracting xml subtree text (string) for entire subtree of XML node
user name
2006-06-22 17:31:05

Hi,

 

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 subtree230; an example would be helpful.

 

Thanks,

Milan

 

extracting xml subtree text (string) for entire subtree of XML node
user name
2006-06-22 21:18:42
On Thu, Jun 22, 2006 at 10:31:05AM -0700, Andric, Milan
wrote:
> Hi, 
>  
> 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

-- 
Daniel Veillard      | Red Hat http://redhat.com/
veillardredhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ |
Rpmfind RPM search engine http://rpmfind.net/
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xmlgnome.org
http://mai
l.gnome.org/mailman/listinfo/xml
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )