TOC PREV NEXT INDEX

Netscape and XSLT


string()

The string() function converts its argument to a string value. Any value can be converted to a string using the following rules:

Datatype
Conversion Rules
Number
NaN is converted to "NaN". Positive and negative zero are converted to "0". Positive infinity is converted to "Infinity". Negative infinity is converted to "-Infinity". Integers are represented without decimal points and with no leading zeros. Negative integers are preceded by the minus sign (-). All other numbers are represented as strings with a decimal point, and at least one digit before and at least one after that decimal point. No leading zeros except, when appropriate, one before the decimal point. After the decimal point, only as many digits as needed to distinguish the number from other IEEE 754 numeric values.
String
Value is unchanged.
Boolean
False becomes "false"; true becomes "true".
Node-set
An empty node-set becomes the empty string. Otherwise, the node-set is represented by the string-value of the first node in the set.
A text node becomes the text content. A comment node becomes the comment. A processing instruction becomes the string of everything after the name, not including the ?>. A namespace node becomes the namespace URI. An attribute node becomes the attribute value. A root node or an element node becomes the concatenation of all its descendant text nodes, in document order.

Syntax:
string string(value [optional]) 
Arguments:
A value of any XSLT/XPath supported datatype. If no argument is specified, the function uses the context node.
Result:
A string.
Defined: XPath, section 4.2.
NS support: Supported.

Comments? devdoc-feedback@netscape.com
TOC PREV NEXT INDEX