axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dennis Sosnoski <...@sosnoski.com>
Subject Re: [Axis2] Problem running wsdl2java on wsdl with multiple imports
Date Thu, 08 Mar 2007 08:00:20 GMT
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* <dms@sosnoski.com 
> <mailto:dms@sosnoski.com>> 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: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message