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. Thanks, Yong Chen > -----Original Message----- > From: Daniel Veillard [mailto:[EMAIL PROTECTED] > Sent: Tuesday, June 26, 2007 2:38 AM > To: Yong Chen (yongche) > Cc: [email protected] > Subject: Re: [xml] Question regarding Xpath and streaming > > On Mon, Jun 25, 2007 at 06:24:46PM -0700, Yong Chen (yongche) wrote: > > > > Hi, > > > > 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 > > together. > > > > 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 > http://xmlsoft.org/html/libxml-pattern.html , but I don't > have user friendly docs for it. > > Daniel > > -- > Red Hat Virtualization group http://redhat.com/virtualization/ > Daniel Veillard | virtualization library http://libvirt.org/ > [EMAIL PROTECTED] | 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/ [email protected] http://mail.gnome.org/mailman/listinfo/xml
