W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > January to March 2001

Is there an indicator for the root element?

From: Zhang, Tao <TZhang@coair.com>
Date: Wed, 7 Mar 2001 11:22:46 -0600
Message-ID: <0FAF1EF6D259D2119F7900805FA7A8A20A13AAE2@CHQSEXC02>
To: "'www-xml-schema-comments@w3.org'" <www-xml-schema-comments@w3.org>


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:element name="shipTo" type="Address"/>
	   <xsd:element name="billTo" type="Address"/>
	   <xsd:element name="items"  type="xsd:string"/>
	  <xsd:attribute name="orderDate" type="xsd:date"/>

	 <xsd:complexType name="Address">
	   <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:attribute name="country" use="fixed" value="US"/>

	 <xsd:complexType name="Remarks">
	   <xsd:element name="preferReceiveBy" type="xsd:date"/>
	   <xsd:element name="specialConcern" type="xsd:string"/>

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.

Received on Wednesday, 7 March 2001 12:23:36 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:49:54 UTC