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

RE: positional predicates in XPath vs XQL

Subject: RE: positional predicates in XPath vs XQL
From: "Howard Katz" <howardk@xxxxxxxxxx>
Date: Sat, 24 Nov 2001 03:35:03 -0800
howard katz
> 1  section
> 2       para
> 3       para
> 4  section
> 5       para
> 6  section
> 7       para
> 8       para
> 9       para
>
> [Note that this is not a well-formed XML document, though XPath
> can work on well-formed text entities such as this.]

Right.

> The XPath is equivalent to the expanded syntax
> /child::section/child::para[position()=1].  The first / selects the root
> node.  The next expression selects all <section> children of the root -
> nodes 1, 4, and 6 in your example.  The next expression, child::para,
> selects nodes for each node in its context.  For node 1, nodes 2
> and 3 are  selected; for node 4, node 5 is selected; for node 6, nodes 7,
8,
> and 9 are selected.  For each node set, the predicate is evaluated,
> returning true for nodes 2, 5, and 7, as they are each the first in their
node set.

Ah, that was what I needed. I had just spent 1/2 hour trying the parse the
English in the section of the XPath specification on predicates and had
obviously failed miserably. Your example makes it much clearer.

Thanks,
Howard

> ~Chris
>
> P.S. YM "ratiocination".  HTH.  HAND.

Huh?


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


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.