W3C home > Mailing lists > Public > xmlschema-dev@w3.org > June 2001

Re: validating xml schemas with the standard schema

From: Eddie Robertsson <eddie@allette.com.au>
Date: Wed, 06 Jun 2001 10:54:39 +1000
Message-ID: <3B1D7F4E.5D1440A@allette.com.au>
To: Paul Jakubik <pauljakubik@yahoo.com>
CC: xmlschema-dev@w3.org
> > one thing that could cause your problem
> > is that you use xsi:schemaLocation in your schema.
> > xsi:schemaLocation is used in the
> > _instance_ document to give the schema processor a
> > hint on where to find the schema to be
> > used for validation.
>
> You are right. But in this case I am wanting to
> validate the schema against the schema-for-schemas. So
> my schema needs to be able to specify a location for
> 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">

Hope this helps.
Cheers,
/Eddie
Received on Tuesday, 5 June 2001 20:55:26 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:21 GMT