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"))) {
          postvalid++;
          loaddtd++;
          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 !

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]