Re: [xml] Question regarding Xpath and streaming

On the same note, is there any way to validate a document (against a
schema) which is being streamed out using xmlWriter? 

"xmlSchemaValidateDoc(validCtxtPtr, doc)" needs a "doc", but when doing
streaming, I don't have the full doc available.

Yong Chen

-----Original Message-----
From: Daniel Veillard [mailto:veillard redhat com] 
Sent: Tuesday, June 26, 2007 2:38 AM
To: Yong Chen (yongche)
Cc: xml gnome org
Subject: 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 

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