[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Find the Position Index of Elements
On 13/06/2010 20:43, Alice Wei wrote:
Hi, whenever you use /a/b/c/[something='zzz'] you should think of doing key('x','zzz') instead, it can be surprising the speedup you can get
you don;t say if you are using xslt 1 or 2. xslt 1 doesn't have a datatype that can store a sequence of integers. You can get the numbers as for example <xsl:for-each select="/music_songs/song[category='Rock']"> and then use <xsl:number/> or <xsl:value-of select="count(preceding-sibling::song[category='Rock'])+1)"/> Ib xslt2 you can store a list of integers /music_songs/song[category='Rock']/count(preceding-sibling::song[category='Rock'])+1) for example would work (although is paerhaps rather inefficient) David
|
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
|