RE: [xml] How to auto-validate against DTD or schema?


Are you saying that if I switch over to using the tree APIs, I will be
able to auto-validate against either a DTD or a schema, whichever
happens to be present in the document? Or will I still need to handle
this auto-detection myself? Thanks for your help.

-----Original Message-----
From: Daniel Veillard [mailto:veillard redhat com] 
Sent: Tuesday, November 16, 2004 9:52 AM
To: Parag Chandra
Cc: xml gnome org
Subject: Re: [xml] How to auto-validate against DTD or schema?

On Tue, Nov 16, 2004 at 09:36:57AM -0500, Parag Chandra wrote:


I've been using libxml2 to validate against DTDs thus far, by passing
the XML_PARSE_DTDVALID flag when I construct an xmlReader. Now I need
do so against schemas, and I can't seem to figure out how to do it
of explicitly passing the name of the schema to validate against to
xmlSchema* APIs. This would require knowing the name of the schema
of time, which I do not. Is there some way to automatically validate
against either a DTD or schema, depending on which is present in the
document? Thanks.

  No, currently the Schemas validating API does not work on a reader, it
needs a full tree.


Daniel Veillard      | Red Hat Desktop team
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]