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.
Copyright © Galileo Press, Bonn 2008
You may print the online version for your private use.
Otherwise, this chapter from "XSLT 2.0 & XPath 2.0 ― Das umfassende Handbuch" is subject to the same terms as the printed edition: the work and all its parts are protected by copyright. All rights are reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
Galileo Press, Rheinwerkallee 4, 53227 Bonn