Re: validating xml schemas with the standard schema

[comments at the bottom]

--- Eddie Robertsson <eddie@allette.com.au> wrote:
> > You are right. But in this case I am wanting to
> > validate the schema against the
> > schema-for-schemas.
> > 
> > Is this the right way to specify it? If so, then I
> > can look into other issues.
> 
> Yes, it is the correct way to specify it but the
> xsi:schemalocation attribute is not
> allowed on the xsd:schema element. In order to do
> this you have to add the following
> DOCTYPE declaration at the top of your schema
> document:
> 
> <!DOCTYPE xsd:schema [
>  <!ENTITY % schemaAttrs 'xsi:schemaLocation CDATA
> #IMPLIED
>                            xmlns:xsi CDATA
> #IMPLIED'>
> ]>
> 
> After you have done this you can add the
> xsi:schemaLocation attribute to your xsd:schema
> element and it would look something like this:
> 
> <xsd:schema
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="qualified"
>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://www.w3.org/2001/XMLSchema
> http://www.w3.org/2001/XMLSchema.xsd">

Thanks Eddie,

This helped a lot. The parser now loads the Schema
properly. It then looked for the datatypes.xsd, which
I copied from
http://www.w3.org/TR/xmlschema-2/#schema.

Evidently the datatypes.xsd is not intended for actual
use. It uses xs:anySimpleType as a base for the simple
types, and admits that this is artificial since these
types should actually be built into the parser.

So, would removing the reference to the datatypes.xsd
in the XMLSchema.xsd make things parsable? Or would it
be better to just remove any of the declarations in
the datatypes.xsd that use anySimpleType as a base?

Is there a set of schemas that is actually intended to
be used to validate schemas? Should I just use the
DTDs instead?

--Paul

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

Received on Wednesday, 6 June 2001 14:05:56 UTC