This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Fwd: complex XPATH test


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]