Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

XSLT Element

XSLT xsl:number Element


XSLT Element Reference Manual Complete XSLT Element Reference Manual


Definition and Usage

xsl:number element is used to determine the integer position of the current node in the source. It is also used to format numbers.


Syntax

count="expression"

level="single|multiple|any"

from="expression"

value="expression"

format="formatstring"

lang="languagecode"

letter-value="alphabetic|traditional"

grouping-separator="character"

grouping-size="number"/>

property

property Value Description
count expression Optional. An XPath expression that specifies the nodes to count.
level single
 multiple       

 any | 可选。控制如何分配序号。     

可以使用的值:

  • single (default)
  • multiple
  • any (not supported by Netscape 6)
  • | | from | expression | Optional. An XPath expression specifying where to start counting. | | value | expression | Optional. Specifies a user-supplied number to use in place of the generated sequence number. | | format | formatstring | Optional. Defines the output format of the number. Possible values: | | lang | languagecode | Optional. Specifies the language alphabet to use for numbering. (Not supported in Netscape 6) | | letter-value | alphabetic traditional | Optional. Specifies whether numbering in the selected language is an alphabetic sequence ("alphabetic") or some other sequence ("traditional"). The value "alphabetic" specifies an alphabetic sequence; the value "traditional" specifies another sequence. Default is "alphabetic". | | grouping-separator | character | Optional. Specifies what character to use to separate groups of digits. The default is a comma. | | grouping-size | number | Optional. Specifies the number of digits in each group separated by the separator specified by the grouping-separator attribute. Default is 3. |

    Example 1

    Output:

    250.000

    Example 2

    Output:

    25,00,00

    Example 3

    grouping-separator="#" format="I"/>

    Output:

    X#I#I

    Example 4

    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">



    XSLT Element Reference Manual Complete XSLT Element Reference Manual