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, optional

This 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 the level, count, and from attributes.

count, optional

This 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, optional

This 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, optional

This 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 the count pattern. It can be set to any 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.