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

RE: How to do an OR within SELECT for a variable

Subject: RE: How to do an OR within SELECT for a variable
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sun, 21 Aug 2005 13:16:08 +0100
RE:  How to do an OR within SELECT for a variable
> > Can I use something like :
> > 
> > <xsl:variable name="var" select="A/B/C|X/D/@ID" />
> > 
> > I think this gets interpretted as 'A/B/C' or 'X/D/@ID'
> 
>     You think correctly.
>     
>     I spell it out, but there may be a more succinct way.
> 
>     <xsl:variable name="var" select="A/B/C/D/@ID|A/B/X/D/@ID"/>

In 2.0 you can write

select="A/B/(C|X)/D/@ID

You have to be careful with such rewrites. I believe this works for "|" but
I discovered that it doesn't work for "except": [A//B//* except A//C//*]
gives a different result from [A//(B except C)//*]. If there's anyone
listening who fancies doing some formal analysis of these expressions for an
M.Sc project, I'd love to see the answers...

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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
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-2013 All Rights Reserved.