Re: Schema being imported multiple times

> 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 UTC