RE: [XML Schema 1.1] Multiple inheritable attributes with the same name ... who wins?

It's the closest one, as you'd expect from the rules for attributes such as
xml:lang and xml:space (and the inherited attributes used by XSL-FO, for
example).

The rules are in 3.3.5.6 Inherited Attributes. To paraphrase, this says that

(a) all inheritable attributes of ancestors of an element E are "potentially
inherited" by E

(b) the actual [inherited attributes] are attributes that are potentially
inherited excluding any that are "masked" by an inner inherited attribute of
the same name.

Section 3.12.4 (rule 1.1.3) then says that in practice, the only [inherited
attributes] that are relevant are those that do not have the same name as
one of the element's "real" attributes.

One corner case to be aware of is

<a att="3">
  <b att="4">
    <c/>
  </b>
</a>

where element a defines att as an inherited attribute, while element b
defines att as a non-inherited attribute. In this case element c effectively
has the value <c att="3"/>.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 

> -----Original Message-----
> From: xmlschema-dev-request@w3.org 
> [mailto:xmlschema-dev-request@w3.org] On Behalf Of Costello, Roger L.
> Sent: 01 July 2009 17:25
> To: xmlschema-dev@w3.org
> Subject: RE: [XML Schema 1.1] Multiple inheritable attributes 
> with the same name ... who wins?
> 
>  
> Hi Folks,
> 
> If there are multiple inheritable attributes up an element's 
> ancestor chain - all with the same name - which one applies? Is it:
> 
>   - the closest one?
>   - the furthest one?
>   - an error?
> 
> /Roger
> 
> > -----Original Message-----
> > From: Costello, Roger L. 
> > Sent: Tuesday, June 30, 2009 9:56 AM
> > To: xmlschema-dev@w3.org
> > Subject: [XML Schema 1.1] Multiple inheritable attributes with the 
> > same name ... who wins?
> > 
> > 
> > Hi Folks,
> > 
> > Suppose a <Beverage> element has multiple ancestor elements with an 
> > inheritable attribute, start-time. The <Beverage> element has an 
> > <assert> or <alternative> element that references start-time. Which 
> > start-time applies?
> > 
> > Example: Suppose each start-time attribute is inheritable:
> > 
> > --------------------------------------
> > <Conference start-time="08:00:00">
> > 
> >     <Meeting start-time="13:00:00">
> >         
> >         <Beverage>Juice</Beverage>
> > 
> >     </Meeting>
> > 
> > </Conference>
> > --------------------------------------
> > 
> > Suppose <Beverage> has an <assert> element:
> > 
> >     <assert test="@start-time lt 12:00:00" />
> > 
> > If the <Meeting> element's start-time applies then the 
> instance data 
> > is invalid.
> > 
> > If the <Conference> element's start-time applies then the instance 
> > data is valid.
> > 
> > Which start-time applies?
> > 
> > /Roger

Received on Wednesday, 1 July 2009 16:49:15 UTC