Name
xsl:number
Synopsis
<xsl:number value = "number-expression
" count = "pattern
" from = "pattern
" level = "single" | "multiple" | "any" format = "letter or digit
" lang = "langcode
" letter-value = "alphabetic" | "traditional" grouping-separator = "char
" grouping-size = "number
" />
The xsl:number
instruction inserts a formatted integer into the result
tree.
Attributes
value
, optionalThis XPath expression returns the number to be formatted. If necessary, the result of the expression is rounded to the nearest integer. The
value
attribute is often 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
, andfrom
attributes.count
, optionalThis attribute contains a pattern that specifies which nodes should be counted at those levels. The default is to count all nodes with the same node type (element, text, attribute, etc.) and name as the current node.
from
, optionalThis attribute contains a pattern identifying the node from which counting starts; that is, it identifies a node that serves as a cutoff point. Any nodes that precede this node are not counted, even if they match the
count
pattern.level
, optionalThis attribute specifies which levels of the source tree should be considered in determining the position of the current node. It can be set to
single
to count the preceding siblings of the current node’s ancestor that match thecount
pattern. It can be set toany
to count ...
Get XML in a Nutshell, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.