W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2004

determine root element in the xml from schema

From: Lingzhi Zhang <lzhang@cse.ogi.edu>
Date: Sat, 6 Mar 2004 15:40:49 -0800 (PST)
To: dev xmlschema <xmlschema-dev@w3.org>
Message-ID: <Pine.SOL.4.21.0403061530390.19322-100000@state.cse.ogi.edu>


Hi,

I am confused of how to determine root element in the xml from a given
schema. It seems to me there is "ambiguity".

Say if we have schema like:
<schema ...>
    <element name="A">
	<complexType>
	...
	    <element ref="B"/>
	...
	<complexType>
    </element>
    <element name="B"/>
<schema>

Either xml:
<A><B></B></A>

or xml:
<B></B>

would be valid xml against the schema. So either A or B could be root
element in the xml. By just looking at the schema without looking at xml,
we can't tell which on would be root element in the xml. However, if a
user defines that schema, he/she usually means that A is the root. Isn't
it "ambiguous"?

Stephen
Received on Saturday, 6 March 2004 18:40:51 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 23:40:23 UTC