Numbering

In addition to sorting, you can also use XSLT to automate the numbering of items. For example, if you had a list of names that you wanted to number, you could use the xsl:number element to automatically process the names for numbering.

xsl:number

The xsl:number element allows you to number items automatically, based on criteria you select, and with a numbering system, which you specify. The element accepts a number of attributes, including

  • format— The format attribute allows you to specify the number format to be used for numbering. The default value is “1”; however, you can also substitute characters, to number items with letters—for instance A, B, C…. Common values for format include “A,” “a,” “I,” and “i.”

  • value— This attribute is ...

Get Special Edition Using XML, Second 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.