Restricting global 'CommonType' elements in instance documents

I am building a schema set that is comprised of numerous specific business scenario schemas (ie., Customer Create, etc.) and a 'common type' schema which defines elements that are made accessible to each of these client schemas.

The element declarations in the common type schema are global and are ref'd in the client schemas, which have included the commonTypes schema.

For instance:

CommonTypes.xsd defines...
<schema>
  <element name="POBox" type="string" />
</schema>

and a client schema includes and uses it...
<schema>
  <include schemaLocation="CommonTypes.xsd">
  <element name="Foo">
    <complexType>
      <element ref="POBox">
    </complexType>
  <element>
</schema>

<POBox> is defined as a distinct string element (as opposed to Foo just employing a native string type in-line) for future consideration. It's likely that it (and others like it) will be expanded down the road.

The problem is that, under the current design, there is no way to restrict an instance document from providing <POBox> as the root element, since it's a global element in an included schema. 

I'd like to keep these basic commonTypes as they are (for future growth) but also constrain the available root for instance documents.

Any pointers to the solution are appreciated !
Thanks,
V.Mathew



---------------------------------
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!

Received on Monday, 24 March 2003 14:47:19 UTC