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

Re: choose an "artificial" root node

Subject: Re: choose an "artificial" root node
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 16 Feb 2001 10:04:39 GMT
Re:  choose an "artificial" root node
> Thanks a lot for your reply, I had thought about that, it's a possibility,
> but the <xsl:number count="*" level="any"> is usable only within the
> "template match" itself. I mean, I can't use sth like : <xsl:apply-templates
> select=*[xsl:number()=$id] /> so this would mean I'd have to process every
> node and compare its number with $id until I reach the one I want... Much
> too heavy. Thanks anyway.

One of the implementers may correct me, but I'm not sure if it is so
much heavier the *[ there is in some sence processing all the nodes
anyway even if it is hidden inside an XPath rather than explictly using
templates. 

If you do want something callable as an XPath function then alternatives
are 
position() or count() with the exact expression depending on
quite what your document structure is, but for instance 
foo{count(preceding::*)}
might do what you want (You could use a key to pre-compute all of them
to save re-calculating, perhaps)

David



_____________________________________________________________________
This message has been checked for all known viruses by Star Internet delivered
through the MessageLabs Virus Control Centre. For further information visit
http://www.star.net.uk/stats.asp

 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.