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">
		<element name="X" type="typeB"/>

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

Similarly, if I say:

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

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
Received on Tuesday, 18 December 2001 10:43:41 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:14:56 UTC