Re: [xml] Question regarding Xpath and streaming

On Mon, Jun 25, 2007 at 06:24:46PM -0700, Yong Chen (yongche) wrote:


I've a question regarding xpath and streaming (xmlWriter):

I use xpath to filter a document so I get selected (or filtered) nodes.
I also use xmlWriter to stream output. I wonder if I can use both

Libxml xpath works by first getting xmlXpathContextPtr (API:
xmlXpathNewContext(doc)), this means the document (doc) has to be
available. But if I'm streaming the data into a file
(xmlNewTextWriterFilename()), I don't have the doc available. So how can
I apply the xpath filtering in xmlWriter streaming?

  Normal XPath operations require a full tree.
  There is a pattern module allowing to stream for a very small subset of
XPath, see , but I don't have
user friendly docs for it.


Red Hat Virtualization group
Daniel Veillard      | virtualization library
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]