Name
<xsl:number>
Synopsis
This element inserts a formatted integer into the result tree. The value of this number can be determined by the attributes or generated by the XSLT processor. The attributes are described as follows:
-
value This attribute contains an XPath expression returning the number to be formatted. If necessary, the number is rounded to the nearest integer. Most commonly, the
valueattribute is omitted, in which case the number is calculated from the position of the current node in the source document. The position is calculated as specified by thelevel,count, andfromattributes.-
count This attribute contains a pattern that specifies which nodes should be counted at those levels. The default is to count all nodes of the same node type (element, text, attribute, etc.) and name as the current node.
-
from This attribute contains a pattern identifying the node from which counting starts; that is, it says which node is number 1.
-
level This attribute can be set to
single(all preceding siblings of the ancestor of the current node that match thecountpattern),multiple(for nested counting of each type of ancestor of the current node that match thecountpattern), orany(count all nodes in the document that match thecountpattern and precede the current node). The default issingle.-
format This attribute determines how the list will be numbered. Format tokens include:
1, 2, 3, 4, 5, 6
01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12
A, B, C, D...Z, AA, AB, AC...
a, b, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access