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

RE: Indexing Tree Elements

Subject: RE: Indexing Tree Elements
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Fri, 7 Jul 2000 14:10:50 +0100
stan ozier
> I have a template that is called for all instances of an element;
> is it possible that it may compare its attributes with the attributes
> of the previous document-tree node of the same level?  Is it possible
> to index elements in such a manner?

Yes (in XSLT) (well almost).

<xsl:if test="@value=preceding-sibling::*[1]/@value">

does roughly what you want. The only caveat is that the "previous node on
the same level" must be a sibling, not a cousin. If you want to test against
an n-th cousin for any value of n, use
preceding::*[count(ancestor::*)=$depth][1] where $depth is initialized to
count(ancestor::*) for the context node. And be patient while it executes.

I'm not sure what you mean by "indexing elements".

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.