Simple numbering

The Number element is replaced by a sequential value in the output. In its simplest form, using none of the attributes described below, this element is replaced by a value that represents the position of the element being processed within its list of sibling elements. The following template numbers each step in a list of procedures. Note that, although other elements may occur amongst the numbered elements, they do not interfere with the numbering process in any way:

   <procedure>
     <title>Getting Through a Locked Door</title>
     <step>walk to the door</step>
     <para>Make sure you have the key!</para>
     <step>insert the key in the lock</step>
					<step>turn the key</step>
					<step>turn the handle</step>
					<step>push</step> </procedure> <xsl:template ...

Get XSL companion, The 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.