Re: The <xs:assert> element cannot use inheritable attributes?

Inherited attributes are a very limited feature. They were introduced to 
meet a very specific use case related to xml:lang. xml:lang is related 
to internationalization, and anything related to internationalization in 
W3C is highly political, which means that you often end up with 
technical features that are not architecturally very clean. We tried to 
generalize the xml:lang use case to cover other attributes with similar 
"inherited" semantics, and considered generalizing it to make these 
attributes appear as "first class" attributes of all descendant elements 
for all purposes (rather as if a default value had been specified for 
the attribute), but too many complications appeared, so we retreated to 
a position closer to "doing the minimum necessary to meet the use case".

There's a tension here between the inherited semantics of attributes 
like xml:lang (and xml:space, and others such as version in XSLT) and 
the XSD philosophy that validation of a node should be context-free - if 
a node is valid, and you copy it to another document, then it should 
still be valid. Restricting the visibility of these attributes for use 
in CTA is an attempt to resolve this dichotomy - here, the inherited 
attribute can affect which type you choose to validate against, but it 
can't affect validity against that chosen type.

Michael Kay
Saxonica


On 07/12/2012 09:45, Costello, Roger L. wrote:
> Hi Folks,
>
> It is my understanding that <xs:assert> elements cannot use inheritable attributes (that is, the xpath expression in the <xs:assert> element's @test attribute cannot reference attributes declared with inheritable="true").
>
> Only <xs:alternative> elements can use inheritable attributes.
>
> Do I have a correct understanding?
>
> If yes, why is it that <xs:assert> elements cannot use inheritable attributes?
>
> /Roger
>
>

Received on Friday, 7 December 2012 10:16:54 UTC