XML technologies / XSLT / Introduction to XSLT 2.0 / XSLT and XPath – round two / Numbering, counting and summing

(Excerpt from "XSLT 2.0 & XPath 2.0" by Frank Bongers, Chapter 2.)

In the context of presenting processed content, numbering is often desired. This applies, for example, when outputting a list, but also when numbering chapters in large documents, possibly following the document hierarchy. You can obtain such numbering as a side effect of conversion to HTML. It can also be generated explicitly, with detailed control, using XSLT instructions.

XSLT and XPath can do more: nodes can be counted and their contents summed, provided those contents are numeric.

  

   

back to top