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

RE: level, from, and count in xsl:number

Subject: RE: level, from, and count in xsl:number
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Fri, 21 May 1999 10:56:51 +0100
count in xsl
You catch me with a sore head from implementing these features for SAXON
over the last 24 hours! I agree, they're pretty messy, but there are plenty
of things you can do with xsl:number that you can't do easily with
position(). The problem with position() is that it's the position of the
current node in the current node list; what you really want is a function
that returns the position of the current node (or possibly some other node)
in an arbitrary node list. If you had that, then I agree there would be
little case for level, from, and count. For example, one might write


to achieve the effect of level=ANY count=ITEM from=BOOKLIST

level=MULTI is a bit trickier but I'm sure it could be achieved as well.

The other messiness in xsl:number is that XSLT now has two completely
separate schemes, both elaborate yet incomplete, for converting numbers to
strings. There must be scope to rationalise this.

I also question why xsl:number is an XSL element rather than a function: if
it were a function it would be possible to post-process the result. (Of
course you can assign it to a variable, but that still has limitations, e.g.
you can't sort on the result).

Mike Kay

Puzzle corner: one thing the SAXON XSL compiler does is to process nodes in
reverse document order. (It actually does this for the xsl:sort nodes, if
you're interested). I'm trying to find a way to do this using standard XSL.
Any suggestions? 

> -----Original Message-----
> From: Elliotte Rusty Harold [mailto:elharo@xxxxxxxxxxxxxxx]
> Is there anything the level, from, and count attributes of 
> xsl:number do
> that can't be done more easily with the expr attribute and 
> position()? 

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread


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.
First Name
Last Name
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.