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

Re: Schema being imported multiple times

From: Eddie Robertsson <eddie@allette.com.au>
Date: Tue, 11 Sep 2001 10:15:19 +1000
Message-ID: <3B9D5797.35496FCB@allette.com.au>
To: "Nguyen, Thang" <nguyet3@anz.com>
CC: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
> Schema1.xsd
> Schema2.xsd
> Common.xsd
>
> Schema1.xsd  imports Common.xsd
>
> Schema2.xsd imports both Common.xsd and Schema1.xsd
>
> I'm using MSXML4.dll (Visual Basic 6) and schema validation.  When I create
> Schema1.xml and validate it with VB, it's fine but when I create Schema2.xml
> and validate, it comes up with an error   "  The '{urn:Common}
> RevisionNumber' element has already been declared"
> (but the validation is successful withing XML Spy)
>
> This is because Common.xsd is being pulled into the SchemaCache twice (once
> from Schema2.xsd and once from Schema1.xsd).
>
> is there a way to work around this error?

Like Eric already said it is an error for MSXML4 to report this as an error but
I think this has been fixed for the final release.
In the meantime I think a workaround would be to include only Schema1.xsd in
your Schema2.xsd file. Since Schema1.xsd already import Common.xsd these
declarations should be available to Schema2.xsd as well.

Cheers,
/Eddie
Received on Wednesday, 10 October 2001 20:08:57 GMT

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