I would like to support a new type of element, lets call it
<gl:numbered-item> which will have the item number instead of
a check box in front of it. So for each list with numbered
items in it, the XSL will need to calculate the position of
the sibling under the parent list. Can and should this be
done that way?
Yes.
There are two ways of calculating the position: <xsl:number/> gives you the
number by counting siblings in the source tree, position() gets it by
counting nodes in the sequence selected by the calling xsl:apply-templates.
In your case, both give the same answer. The position() call is probably
more efficient, but it does create a hidden dependency between the two
template rules, which you may not like.
Regards,
Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--