The <xsl:number> Element

You use <xsl:number>to assign a number in a sequence to a node in the result document. For example, you can number paragraphs in a contract or stanzas in a poem. You can even number parts of a document down to multiple levels, such as “Paragraph 3.2.5.1.” and so on.

Here are the <xsl:number> element’s attributes:

  • level(optional). Determines how sequence numbers are assigned. Set to “single”, “multiple”, or “any”. The default is “single”.

  • count(optional). Determines which nodes are to be counted. Set to a pattern.

  • from(optional). Determines the point at which counting starts. Set to a pattern.

  • value(optional). A number to be formatted.

  • format (optional). Determines the output format. Set to an attribute value template that ...

Get Inside XSLT 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.