Semantics of elementFormDefault / Form

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 UTC