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

Re: are multiple predicates same as boolean and

Subject: Re: are multiple predicates same as boolean and
From: Ronan Klyne <ronan.klyne@xxxxxxxxxxx>
Date: Fri, 21 Nov 2008 14:13:56 +0000
Re:  are multiple predicates same as boolean and
Mukul Gandhi wrote:
> thanks David for the answer. I have few more questions
> 
> On Fri, Nov 21, 2008 at 7:13 PM, David Carlisle <davidc@xxxxxxxxx> wrote:
>> X[position()=2][position()=2]
> 
> I think this would mean, X[2][2] which will always be an empty sequence, i.e. ()
> am I correct?
> 
> apart from this use case you cited, are all other forms equivalent
> (which do not involve positional predicates)?

No.

> like,
> X[@a='hi'][@b='hi..']

If X[@a='hi'] matches a node, then that node will become the context
node when evaluating [@b='hi..']

> would be same as
> X[@a='hi' and @b='hi..']

X is the context node here, so the predicate will be considering @b='hi..'

X[P][Q] is equivalent to X[P and Q] if and only if Q does not depend on
the context node at all.

To extend this:

X[P][Q][]...[Z] is equivalent to X[P and Q ... and Z] if and only if Q,
R, .. Z do not depend on the context node at all.
 (In all cases, X is the context node when evaluating P, so P can depend
on the context node.)


	Ronan

-- 
Ronan Klyne
Business Collaborator Developer
Tel: +44 01189 028518
ronan.klyne@xxxxxxxxxxx
www.groupbc.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.