<xsl:number> element counts things sequentially. It can also be used to quickly format a number.
<xsl:number count=EXPRESSION level="single" | "multiple" | "any" from=EXPRESSION value=EXPRESSION format=FORMAT-STRING lang=XML:LANG-CODE letter-value="alphabetic" | "traditional" grouping-separator=CHARACTER grouping-size=NUMBER />
- Specifies what in the source tree should be numbered sequentially. It uses an XPath expression.
- Defines how levels of the source tree should be considered in generating sequential numbers. It has three valid values:
any. The default value is
- Numbers sibling nodes sequentially, as in the items in a list. The processor goes to the first node in the
ancestor-or-selfaxis that matches the
countattribute and then counts that node plus all its preceding siblings (stopping when it reaches a match to the
fromattribute, if there is one) that also match the
countattribute.If no match is found, the sequence will be an empty list.
- Numbers nodes as a composite sequence that reflects the hierarchic position of the node, e.g. 22.214.171.124. (The nested format can be specified with the
formatattribute, e.g. A.1.1). The processor looks at all
ancestorsof the current node and the current node itself, stopping when it reaches a match for the
fromattribute, if there is one. For each node in this list that matches the
countattribute, the processor counts how many preceding matching siblings it has, and adds one for the node itself. If no match is found, the sequence will be an empty list.
any(Not supported at this time.)
- Numbers all matching nodes, regardless of level, sequentially. The
precedingaxes are all considered. The processor starts at the current node and proceeds in reverse document order, stopping if it reaches a match to any
fromattribute. If no match to the
countattribute is found, the sequence will be an empty list. This level is not supported at this time.
- Specifies where the numbering should start or start over. The sequence begins with the first descendant of the node that matches the
- Applies a given format to a number. This is a quick way to format a user-supplied number (as opposed to a node sequence number) in any of the standard
- Defines the format of the generated number:
- 1 2 3 . . . (This is the only format supported at this time)
- 01 02 03 . . . 09 10 11 . . .
- a b c . . .y z aa ab . . .
- A B C . . . Y Z AA AB . . .
- i ii iii iv v . . .
- I II III IV V . . .
- lang (Not supported at this time.)
- Specifies which language's alphabet should be used in letter-based numbering formats.
- Disambiguates between numbering sequences that use letters. Some languages have more than one numbering system that use letters. If both systems begin with the same token, ambiguity can arise. This attribute can have the value "
alphabetic" or "
traditional". The default is "
- Specifies what character should be used as the group (e.g. thousands) separator. The default is the comma (
- Indicates the number of digits that make up a numeric group. The default value is "
Instruction, appears within a template.
XSLT, section 7.7
Partial support. See comments above.