- From: Cams Ismael <Ismael.Cams@siemens.com>
- Date: Tue, 25 Mar 2003 10:02:57 +0100
- To: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
- Message-ID: <57FD2C3A246F76438CA6FDAD8FE9F1957ABC6C@hrtades7.atea.be>
>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 [Cams Ismael] > 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. Hello Viju, what I do when I have some common types, is to define them only as simpleTypes and complexTypes. When I need an element of that type I create that element on the moment I need it. So what I should do is: CommonTypes.xsd: <schema> <simpleType name="POBoxType"> <xsd:restriction base="xsd:string"/> </simpleType> client schema: <schema> <include schemaLocation="CommonTypes.xsd"> <element name="Foo"> <complexType> <element name="POBox" type="POBoxType"> </complexType> <element> </schema> Now you prevent from using the POBoxType as global element, but it's it still usable by other schemas. Kind regards, Ismaël
Received on Tuesday, 25 March 2003 04:03:10 UTC