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

RE: Fwd: complex XPATH test

Subject: RE: Fwd: complex XPATH test
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Wed, 18 Jul 2001 02:25:21 +0100
xpath test node id
> For starters, there has to be a better way of returning the
> position of a
> node within a node set than what I used here (the for-each
> block).  Anyone
> have any ideas?

The only alternative that comes to mind is
count(xx:intersection($nodeset, preceding::node()))

where xx:intersection can be done either using an extension function or
using
$x[count(.|$y)=count($y)]

But your method is probably faster!

(The other approach is to ask whether you couldn't have determined/retained
the position at the time the node-set was being built in the first place).

> Second, why is it that ".=$curr" tests the value of each
> against each other,
> rather than a 'node id' or something?  Wouldn't it make sense
> for that to
> actually check that the nodes are equivalent

It certainly would make sense for XPath to provide a node-identity test;
whether it would have been better to use the "=" operator for that purpose
is an unanswerable question.

Mike Kay
>


 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.