Name

string() Function — Returns the string value of the argument.

Synopsis

string string(
               object
               )

Inputs

An object. The object is converted to a string, as described in the following subsection.

Output

A string. The input argument is converted to a string as follows:

  • If the argument is a node-set, the first node in the node-set is converted to a string. (The first node in the node-set is the one that occurs first in document order.)

  • If the argument is a number, it is converted to a string as follows:

    • The value NaN is converted to the string “NaN”.

    • Positive zero is converted to the string “0”.

    • Negative zero is converted to the string “0”.

    • Positive infinity is converted to the string “Infinity”.

    • Negative infinity is converted to the string “-Infinity”.

    • An integer is converted to a string representing that integer, using no decimal point and no leading zeros. If the integer is negative, it will be preceded by a minus sign (-).

    • Any other number is converted to a string with a decimal point, at least one number before the decimal point, and at least one number after the decimal point. If the number is negative, it will be preceded by a minus sign (-). There will not be any leading zeros before the decimal point (with the possible exception of the one required digit before the decimal point). After the decimal point, there will be only as many digits as needed to distinguish this number from all other numeric values defined by the IEEE 754 standard, the same standard used by the Java float and ...

Get XSLT 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.