Re: AW: Attributes from different namespaces

On Wed, 2005-12-14 at 14:55, Gregor Zeitlinger wrote:
> Hi Pete,
>  
> thanks for the help. This solved my problem.
> But thinking about it, what would I have to do, when I had two elements that both have attribute b:bAtt, but with different types.
>  
> In my first example, I would do:
> <xsd:attribute name="bAtt" type="b:bAttType" />
> ..
> <xsd:attribute name="bAtt" type="b:bAttType2" />

How many different global attributes named 'bAtt' do
you want the b namespace to have?  XML Schema follows
the lead of XML Namespaces in allowing for one, but
only one.  One attribute, one type, so there is no
provision in XML Schema for assigning different types
to a global attribute depending on which element it
appears on.  

If you want attributes of the same name to take 
different types on different elements, it sounds like
what you want are two different attributes.  That
can easily be done by making the attributes local
to those elements -- but that means declaring them
that way, which means they are either unqualified
or qualified with the target namespace of the element
to which they are local.

I hope this helps.

-C. M. Sperberg-McQueen
 World Wide Web Consortium

Received on Thursday, 15 December 2005 04:21:28 UTC