<html>
<head>
<title>Datatypes</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div id="Description">
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
<tr>
<td valign="top" class="NAME" colspan="2">Datatypes</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td valign="top" colspan="2" class="description">

    <p>
<!--<primary>datatypes</primary>-->

XPath and XSLT define five datatypes, listed here. The <span class="LITERAL">result tree fragment</span> type is defined by XSLT and is specific to transformations; the other four are defined by XPath and are generic to any technology that uses XPath. The four XPath datatypes are tersely defined in Section 1 of the XPath specification; section 11.1 of the XSLT specification defines result tree fragments. </p>
    <dl>
<dt>
<span class="LITERAL">
node-set
</span>
</dt>
<dd>
A set of nodes. The set can be empty, or it can contain any number of nodes.
<P></p>
<dt>
<span class="LITERAL">
boolean
</span>
</dt>
<dd>
The value
<span class="LITERAL">
true
</span>
or
<span class="LITERAL">
false
</span>
. Be aware that the strings
<span class="LITERAL">
true
</span>
and
<span class="LITERAL">
false
</span>
have no special meaning or value in XPath. If you need to use the boolean values themselves, use the functions
<span class="LITERAL">
true()
</span>
and
<span class="LITERAL">
false()
</span>
.
<P></p>
<dt>
<span class="LITERAL">
number
</span>
</dt>
<dd>
A floating-point number. All numbers in XPath and XSLT are implemented as floating-point numbers; the
<span class="LITERAL">
integer
</span>
or
<span class="LITERAL">
int
</span>
datatype does not exist in XPath and XSLT. To be specific, all numbers are implemented as IEEE 754 floating-point numbers, the same standard used by the Java
<span class="LITERAL">
float
</span>
and
<span class="LITERAL">
double
</span>
primitive types. In addition to ordinary numbers, there are five special values for numbers: positive and negative infinity, positive and negative zero, and
<span class="LITERAL">
NaN
</span>
, the special symbol for anything that is not a number.
<P></p>
<dt>
<span class="LITERAL">
string
</span>
</dt>
<dd>
Zero or more characters, as defined in the XML specification.
<P></p>
<dt>
<span class="LITERAL">
result tree fragment
</span>
</dt>
<dd>
<!--<primary>result-tree fragment</primary>-->
A temporary tree. You can create one with an
<span class="LITERAL">
&lt;
xsl:variable
&gt;
</span>
element that uses content (instead of the
<span class="LITERAL">
select
</span>
attribute) to initialize its value. A result tree fragment can be copied to the result tree with the
<span class="LITERAL">
&lt;
xsl:copy-of
&gt;
</span>
element. It may also be converted to a string with the
<span class="LITERAL">
&lt;
xsl:value-of
&gt;
</span>
element.
<P></p>
</dl>
</td></tr>
</table>
</div>
</body>
</html>