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

RE: [XML Schema 1.1] XPath in <alternative> cannot look up or down the tree, correct?

From: Michael Kay <mike@saxonica.com>
Date: Mon, 11 May 2009 13:44:48 +0100
To: "'Costello, Roger L.'" <costello@mitre.org>, <xmlschema-dev@w3.org>
Message-ID: <A264D90F898346B0A248377E3A18660D@Sealion>
RE: [XML Schema 1.1] XPath in <alternative> cannot look up or down the  tree

Yes, that's correct. Well, almost correct. There's a new feature of
"inheritable attributes": if an attribute of an ancestor element of E is
declared as being inheritable, then you can refer to it in xs:alternative as
if it appeared on element E itself. This was put in specifically for
xml:lang, but it works equally well for other attributes that apply
throughout a subtree unless overridden.

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: 11 May 2009 13:17
> To: 'xmlschema-dev@w3.org'
> Subject: [XML Schema 1.1] XPath in <alternative> cannot look 
> up or down the tree, correct?
> 
> 
> Hi Folks,
> 
> I wish to confirm my understanding.
> 
> Here's an example that uses the <alternative> element:
> 
> <xs:element name="Publication" type="PublicationType">
>     <xs:alternative test="____" type="..." /> </xs:element>
> 
> 
> It is my understanding that the XPath expression in 
> test="____" must only reference attributes of Publication. It 
> cannot reference ancestors and it cannot reference descendants. 
> 
> That is, the XPath in an alternative element cannot look up 
> or down the tree.
> 
> Do I have a correct understanding?
> 
> /Roger
Received on Monday, 11 May 2009 12:45:33 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.