xsl:number

Inserts a formatted number into the result tree.

Format

<xsl:number  
  [level = "single" | "multiple" | "any"] 
  [count = pattern] 
  [from = pattern] 
  [value = number-expression] 
  [format = {string}] 
  [lang = {nmtoken}] 
  [letter-value = {"alphabetic" | "traditional"}] 
  [grouping-separator = {char}] 
  [grouping-size = {number}]/>  

Description

You can use the value attribute to specify an expression for the number to be inserted. The XSLT processor evaluates the expression. The resulting object is converted to a number as if by a call to the number() function. The processor rounds the number to an integer and then uses the specified attributes to convert it to a string. The value of each attribute is interpreted as an attribute value template. After conversion, the resulting string is inserted in the result tree.

The following attributes control how the current node is to be numbered:

Example

The following example numbers a sorted list:

<xsl:template match="items"> 
  <xsl:for-each select="item"> 
    <xsl:sort select="."/> 
<p> 
  <xsl:number value="position()" format="1. "/> 
  <xsl:value-of select="."/> 
</p> 
  </xsl:for-each> 
</xsl:template> 

Generating Java Code with Stylus Studio

This is a video tutorial on how to generate Java Code with Stylus Studio

Using DTD in Microsoft Applications

Learn how to integrate DTD's into your Microsoft applications using MSXML or System.XML DTD processing components.

Translating XML documents to EDIFACT

In-place, via XSLT and via XQuery are all mechanisms supported for converting XML to EDIFACT

Apache FOP

Apache FOP is an open-source engine is available from the Apache project that renders XSL-FO into PDF and other popular document formats. Apache FOP is fully integrated with Stylus Studio's XSL:FO tools.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member