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

Re: Multiple include problem in XML-Schema (XSD).

From: Eddie Robertsson <eddie@allette.com.au>
Date: Tue, 12 Jun 2001 10:54:16 +1000
Message-ID: <3B256838.4854E1F8@allette.com.au>
To: "Venkateswar, Wunnava" <Wunnava.Venkateswar@kla-tencor.com>
CC: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
Hi,

"Venkateswar, Wunnava" wrote:

>
>
> Hi,
> Is there a mechanism in XML-Schema specification by which I can stop
> multiple includes of a Schema (XSD)?

Not that I know of.

> I have the following scenario.
> Schema-A.xsd "includes" "CustomDatatypes.xsd"
> Schema-B.xsd "includes" "CustomDatatypes.xsd"
> Schema-C.xsd "includes" "CustomDatatypes.xsd"
> "Schema-D.xsd" "includes" "Schema-A.xsd" AND "Schema-B.xsd" AND
> "Schema-C.xsd".
> This causes "redefinition" errors for the datatypes in the
> "CustomDatatypes.xsd" because it is included multiple times. Is there
> a syntax in XMLSchema language to work around this. Unfortunately I
> need to have the schemas:Schema-A, Schema-B, Schema-C in separate
> documents because I have to validate instances of documents that
> confirm to these schemas alone.

You should still be able to integrate A, B and C into one document since
all global element declarations can work as the root in your instance
document. This means that the element you intend to use as the root
element from A, B and C respectively shoud all be global declarations in
the new schema document.

> Can any one suggest a solution or any thing I am doring wrong or
> missing.

I'm not sure what the spec says about this but I think that XSV only
gives you a warning for the above senario. I don't know what the correct
behaviour is.

Cheers,
/Eddie
Received on Monday, 11 June 2001 20:54:05 GMT

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