Maybe we should ask for clarification from Priscilla on this, but my
intepretation of

        "Locally scoped attribute and element declarations"

is that the rule refers only to unqualified attributes and elements.
If you specify elementFormDefault="qualified", then all elements in
the schema are globally scoped unless you specify form="unqualified"
on a specific element.

Anne

On 3/8/07, Dennis Sosnoski <[EMAIL PROTECTED]> wrote:
Hi Amila,

No, there is no such constraint. Schema actually states explicitly
(http://www.w3.org/TR/xmlschema-1/#concepts-nameSymbolSpaces) that:

"Locally scoped attribute and element declarations are special with
regard to symbol spaces. Every complex type definition defines its own
local attribute and element declaration symbol spaces, where these
symbol spaces are distinct from each other and from any of the other
symbol spaces. So, for example, two complex type definitions having the
same target namespace can contain a local attribute declaration for the
unqualified name "priority", or contain a local element declaration for
the name "address", without conflict or necessary relation between the two."

Like most parts of the schema specification, this doesn't appear to be
written for clarity. Why the gratuitous reference to "unqualified name"
when referring to the attribute, for instance, when it doesn't make any
difference whether the name is qualified or unqualified? But the
statement that "each complex type definition defines its own local
attribute and element declaration symbol spaces" is as clear and
definite as anything in schema.

To make things even more complicated, according to Priscilla Walmsley
("Definitive XML Schema", 13.4.4 Duplication of element-type names) you
can reuse the same element name within a particular complex type
definition providing the elements have the same type. This apparently
means that it's fine to do a definition of the type:

<complexType>
  <sequence>
    <element name="name" type="string"/>
    <element name="id" type="long"/>
    <element name="name" type="string"/>
  </sequence>
</complexType>

I don't know the particular entrails which were read to come to this
conclusion (which I haven't found documented in the schema
recommendation), but since she's part of the Schema Working Group her
statements on schema are generally considered authoritative. Something
to keep in mind when you're writing your code to handle complex types.

  - Dennis

Dennis M. Sosnoski
SOA and Web Services in Java
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117



Amila Suriarachchi wrote:
>
>
> On 3/8/07, *Dennis Sosnoski* <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
>
>     Your statement about the names is incorrect, Anne. Schema doesn't
>     allow
>     the same name to be used for different global definitions, but you're
>     fine reusing names for local elements in different complexTypes.
>
> I am also not clear about this and would like to put this question?
> Is there any constranit that says *every element in schema should have
> a unique Qutalified name?*
> since the qualified name of an element only depends on the namespace
> and the local part of the element then we have to conclude that it is
> not possible.
>
> --
> Amila Suriarachchi,
> WSO2 Inc.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to