[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: AW: Attributes

From: C. M. Sperberg-McQueen <cmsmcq@acm.org>
Date: 14 Dec 2005 21:20:49 -0700
To: Gregor Zeitlinger <gregor.zeitlinger@torexretail.de>
Cc: Pete Cordell <petexmldev@tech-know-ware.com>, xmlschema-dev@w3.org
Message-Id: <1134620446.2937.101.camel@localhost>
diffrent types of attributes

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 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.