- 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
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