Re: Cannot validate a ".xsd" file (Xerces 2.7.0 C++ on Windows XP)



ciaran.mchale@xxxxxxxx wrote:

> Hi folks,
>
> I downloaded the binary version of Xerces C++ 2.7.0 for Windows and am
> using it to help me get up to speed with XML and XML Schema. So please
> excuse me if this is a "novice" question.
>
> In the samples/data directory, I ran the following command for all the
> files:
>
> DOMPrint -n -s -f -v=always <filename>
>
> The above command worked for the two ".xml" files. So far, so good.
>
> The above command failed for the ".dtd" files. This is fine because a
> ".dtd" file is *not* in XML format.

Strictly speaking, a DTD *is* in XML format -- but it uses XML
Declaration Syntax, not XML Document Syntax. A DTD can't therefore
be validated in the same way as an XML document, but it can be checked
for syntax simply by creating a dummy document instance and running
that through software containing a validating parser.

> What confuses me is that the above command failed for the ".xsd" file.
> The file is "well formed", as I can see if I run DOMPrint on it
> *without* the schema validation options. However, when I use the
> schema validation options then DOMPrint complains about 128 "validity"
> errors.
>
> This surprises me because I was expecting to be able to use a
> validating parser (such as Xerces) to validate schemas as well
> as schema instances.
>
> Am I doing something wrong? Is there a mistake in the ".xsd" document?
> Is there a bug in Xerces?

I can't speak for Xerces, but the XSD file you posted validates with
the DTD for Schemas.

///Peter
--
XML FAQ: http://xml.silmaril.ie/

.