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

On Tue, Oct 09, 2007 at 06:59:48PM -0500, Ben Liblit wrote:
If I run xmllint with "xmllint --noxincludenode --postvalid ...", then 
xmllint will check my document against a DTD after all XInclude 
inclusions have been processed.

How do I do post-XInclude validation using a W3C XML Schema instead? 
The obvious "xmllint --noxincludenode --postvalid --schema foo.xsd ..." 
does not work; xmllint still tries to load a DTD.  Inspection of the 
"xmllint.c" source code confirms that "--postvalid" turns on DTD loading:

      } else if ((!strcmp(argv[i], "-postvalid")) ||
               (!strcmp(argv[i], "--postvalid"))) {
          options |= XML_PARSE_DTDLOAD;

Is there simply no way to postvalidate using RelaxNG or W3C XML Schemas?

  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 !


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]