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.

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/



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