W3C home > Mailing lists > Public > xmlschema-dev@w3.org > December 2001

Semantics of elementFormDefault / Form

From: Slein, Judith A <JSlein@crt.xerox.com>
Date: Tue, 18 Dec 2001 10:43:35 -0500
Message-ID: <D753E5FC52E98943AC5C56E4446F89843F4ECE@crte147.wc.eso.mc.xerox.com>
To: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
Cc: "Kurian, Binil" <BKurian@crt.xerox.com>, "Slein, Judith A" <JSlein@crt.xerox.com>, "Sembower, Neil R" <NSembower@crt.xerox.com>, "'Graham Mann'" <gmann@adobe.com>
I am confused about the semantics of elementFormDefault and Form.  Do they
simply determine whether instance documents are forced to make explicit what
namespace a local element belongs to, or do they actually change the
namespace it belongs to?

If I say elementFormDefault="unqualified" and declare a local element, does
the element belong to no namespace?
If I say elementFormDefault="qualified", does the local element now belong
to the targetNamespace?

At least one of the schema processors I use seems to have this
interpretation.  When I say:

<schema . . . elementFormDefault="qualified">
<element name="X" type="typeA"/>
<complexType name="Y">
	<sequence>
		<element name="X" type="typeB"/>
	</sequence>
</complexType>
</schema>

I get an error message that I have defined the same element twice with
different types.

But if I change elementFormDefault to "unqualified", the error message goes
away.

Similarly, if I say:

<schema . . . elementFormDefault="qualified">
<element name="X" type="typeA"/>
<complexType name="Y">
	<sequence>
		<element name="Z" type="typeB"/>
		<any namespace="##other"/>
	</sequence>
</complexType>
</schema>

There is no error, but if I change elementFormDefault to "unqualified", I
get an ambiguous content model error.

Is this interpretation of the meaning of elementFormDefault correct?

Thanks for your help.

Judith A. Slein
Xerox Corporation
(585)422-5169
jslein@crt.xerox.com
Received on Tuesday, 18 December 2001 10:43:41 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:25 GMT