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

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 UTC