- From: Zhang, Tao <TZhang@coair.com>
- Date: Wed, 7 Mar 2001 11:22:46 -0600
- To: "'www-xml-schema-comments@w3.org'" <www-xml-schema-comments@w3.org>
Hi, Is there a standard way to indicate which of the top-level defined elements in the Schema is the real root element in the instance XML document? And this indication can be catched by a program when processing only the Schema. And is there a constraint that other top-level defined elements, if not root element in the instance XML document, must be referred by later defined elements? For example, consider this Schema file and suppose there is no instance XML files available: <xsd:schema xmlns:xsd="http://www.w3.org/2000/08/XMLSchema"> <xsd:element name="purchaseOrder" type="PurchaseOrderType"/> <xsd:element name="comments" type="Remarks"/> <xsd:complexType name="PurchaseOrderType"> <xsd:sequence> <xsd:element name="shipTo" type="Address"/> <xsd:element name="billTo" type="Address"/> <xsd:element name="items" type="xsd:string"/> </xsd:sequence> <xsd:attribute name="orderDate" type="xsd:date"/> </xsd:complexType> <xsd:complexType name="Address"> <xsd:sequence> <xsd:element name="name" type="xsd:string"/> <xsd:element name="street" type="xsd:string"/> <xsd:element name="city" type="xsd:string"/> <xsd:element name="state" type="xsd:string"/> <xsd:element name="zip" type="xsd:decimal"/> </xsd:sequence> <xsd:attribute name="country" use="fixed" value="US"/> </xsd:complexType> <xsd:complexType name="Remarks"> <xsd:sequence> <xsd:element name="preferReceiveBy" type="xsd:date"/> <xsd:element name="specialConcern" type="xsd:string"/> </xsd:sequence> </xsd:complexType> </xsd:schema> It seems there is not way to tell whether it is "purchaseOrder"or "comments" the real root element in the instance XML file. Any suggestion and explanation will be greatly appreciated. Tao
Received on Wednesday, 7 March 2001 12:23:36 UTC