[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: how to get position of node in node-set
Erwin,
Your problem has been a theme lately. (I hope you've been reading.) At 12:06 PM 9/11/2003, you wrote: I have a node-set of entries that all have different values for their text attribute. As a result tree fragment (constructed by the processor and bound to a variable), $legend can't be inspected this way, so if you can't find a way to see that a <entry text="ccc"/> node in your source *will be* the third in your order, you're stuck. If $legend is a true node-set, however, you can traverse it in the usual way, e.g. ask count($legend/entry[@text=current()/@text]/preceding-sibling::*)+1. To make $legend a true node set, use XSLT 2.0 (the draft is partially implemented in the current version of Saxon), or, in XSLT 1.0, your friendly vendor's node-set() extension function. Cheers, Wendell
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|