Re: [xml] post-XInclude validation using schema, not DTD

On Wed, Oct 10, 2007 at 07:55:18AM -0400, Elliotte Harold wrote:
Daniel Veillard wrote:

 The problem only occurs for DTD because DTD validation is defined as
part of the parsing phase ! For RelaxNG or XSD, you parse an existing tree,
so postvalid is by definition of these validation schemes and that flag
should not be used for those !

Not by definition, no. You can validate a document that uses XIncludes 
before or after the includes are resolved. Which to do is up to the 
user. None of the specs require this to be done in any particular order, 
regardless of schema language. Doing it with DTDs, post-XInclude may 
require a reparse, though.

To be clearer 'postvalid' xmllint flag semantic is only for DTD validation.

Now for the order of XInclude and Relax-NG/XSD validation, xmllint does
validation on the resulting tree, this is due to the fact that xmllint will
not get the schemas definitions from the instances (multiple in that case)
for --schemas and --relaxng options, and the likelyhood that the same
schemas will work for the main XML document as well as the XIncluded 
pieces is rather unlikely. You can validate separately the included parts
as they are XML documents with xmllint, or validate the result when using
both flags.


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]