determine root element in the xml from schema

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