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

RE: RE: Postional predicates de-mystified

Subject: RE: RE: Postional predicates de-mystified
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Fri, 4 Jan 2002 10:20:11 -0000
RE:  RE: Postional predicates de-mystified
> >  Evan Lenz wrote:
> > The predicate in the second example is not part of the Step,
> > but is part of
> > a more general FilterExpr. In XPath 1.0, a predicate may
> > follow any kind of
> > expression...
Dave Pawson responded:

> Which seems to be the heart of the matter.
> A quick scan of xpath 2.0 gives a count of node-set about 7
> times (excluding issue related occurences).

Evan's explanation I thought was excellent, but it used the terminology of
XPath 1.0 (which seems approrpriate for its intended audience). The behavior
of these constructs in XPath 2.0 is unchanged, but the terminology used for
explaining the behavior has changed considerably.
> This word 'sequence' however, appears to occur slightly more times :-)
> <quote>A sequence is an ordered collection of zero or more
> items. An item is either a simple value or a node.</quote>
> The 'order' mentioned here, is it document order or can I
> still collect a node-set/sequence in reverse document  order?

A sequence can be in any order. A path expression always returns a sequence
of nodes that are in document order. Other kinds of expression can be used
to obtain nodes in non-document order. For example the expression

  for $i in 1 to count(ancestor::*) return ancestor::*[$i]

will return a sequence containing all the ancestors of the context node, in
reverse document order.

Mike Kay

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread


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.
First Name
Last Name
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.