<html>
<head>
<title>number() ֐</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div id="">
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
<tr>
<td valign="top" class="NAME">number() ֐</td>
<td valign="top" class="COMPATIBILITY">&nbsp;</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[^𐔒lɕϊ܂B </td></tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE"></td>
</tr>
<tr>
<td colspan="2" class="description">
<p>IuWFNgBIuWFNǵÃTuZNVŐ悤ɐlɕϊ܂B </p>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">o</td>
</tr>
<tr>
<td colspan="2" class="description">
<p>lBIuWFNĝ͎悤ɐlɕϊ܂B</p>
<ul>
<dd>p[^u[l̏ꍇAl <span class="LITERAL">true</span> ͐l <span class="LITERAL">1</span> ɕϊAl <span class="LITERAL">false</span> ͐l <span class="LITERAL">0</span> ɕϊ܂B</p>
        </li> 
<dd>p[^m[hZbg̏ꍇAm[hZbg <span class="LITERAL">string()</span> ֐ɓnꂽ̂悤ɕɕϊA͑̕̕Ɠ悤ɐlɕϊ܂B<span class="LITERAL">string()</span> ֐́Am[hZbg̍ŏ̃m[h̕lԂ܂B</p>
        </li>
<dd>p[^̏ꍇ́Â悤ɕϊ܂B</p>
          <ul>
<dd>񂪏ȗ\ȋ󔒃Xy[Xō\ĂāAȗ\ȃ}CiXL (<span class="LITERAL">-</span>)AlAы󔒃Xy[XɑꍇAŕ\鐔lɍł߂_lɕϊ܂BIEEE 754 Wł́A<span class="LITERAL">round-to-nearest</span> K`Ă܂BڍׂɂẮA̕WQƂĂB</p>
            </li>
<dd>̑́̕A<span class="LITERAL">NaN</span> (lł͂Ȃl) ɕϊ܂B</p>
            </li>
          </ul>

        </li>
<dd>p[^̃^Cvłꍇ́Ã^Cvɉ@Őlɕϊ܂BT|[g鑼̃^CvƁA炪lɕϊ@ɂẮAXSLT vZbT̃}jAQƂĂB </p>
        </li>
      </ul>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">`</td>
</tr>
<tr>
<td colspan="2" class="description">
<p>XPath 4.4 ߁uNumber Functionsv</p>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE"></td>
</tr>
<tr>
<td colspan="2" class="description">
<p><span class="LITERAL">number()</span> ֐eXg邽߂Ɏgp XML hLgɎ܂B</p>
<span class="PROGRAMLISTING"><pre>
&lt;?xml version="1.0"?&gt;
&lt;report&gt;
  &lt;title&gt;Miles Flown in 2001&lt;/title&gt;
  &lt;month sequence="01"&gt;
    &lt;miles-flown&gt;12379&lt;/miles-flown&gt;
    &lt;miles-earned&gt;35215&lt;/miles-earned&gt;
  &lt;/month&gt;
  &lt;month sequence="02"&gt;
    &lt;miles-flown&gt;32857&lt;/miles-flown&gt;
    &lt;miles-earned&gt;92731&lt;/miles-earned&gt;
  &lt;/month&gt;
  &lt;month sequence="03"&gt;
    &lt;miles-flown&gt;19920&lt;/miles-flown&gt;
    &lt;miles-earned&gt;76725&lt;/miles-earned&gt;
  &lt;/month&gt;
  &lt;month sequence="04"&gt;
    &lt;miles-flown&gt;18903&lt;/miles-flown&gt;
    &lt;miles-earned&gt;31781&lt;/miles-earned&gt;
  &lt;/month&gt;
&lt;/report&gt;</pre></span>
<p>܂܂ȃp[^gp <span class="LITERAL">number()</span> ֐eXg܂B</p>
<span class="PROGRAMLISTING"><pre>
&lt;?xml version="1.0"?&gt;
&lt;xsl:stylesheet version="1.0" 
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;

  &lt;xsl:output method="text"/&gt;

<!--<?troff .Nd 10?>-->
  &lt;xsl:variable name="newline"&gt;
&lt;xsl:text&gt;
&lt;/xsl:text&gt;
  &lt;/xsl:variable&gt;

  &lt;xsl:template match="/"&gt;
    &lt;xsl:value-of select="$newline"/&gt;
    &lt;xsl:text&gt;Tests of the number() function:&lt;/xsl:text&gt;

    &lt;xsl:value-of select="$newline"/&gt;
    &lt;xsl:value-of select="$newline"/&gt;
    &lt;xsl:text&gt;   number(true())=&lt;/xsl:text&gt;
    &lt;xsl:value-of select="number(true())"/&gt;
    &lt;xsl:value-of select="$newline"/&gt;
    &lt;xsl:text&gt;   number(false())=&lt;/xsl:text&gt;
    &lt;xsl:value-of select="number(false())"/&gt;
    &lt;xsl:value-of select="$newline"/&gt;
    &lt;xsl:text&gt;   number(/report/month[2]/miles-flown)=&lt;/xsl:text&gt;
    &lt;xsl:value-of select="number(/report/month[2]/miles-flown)"/&gt;
    &lt;xsl:value-of select="$newline"/&gt;
    &lt;xsl:text&gt;   number(//miles-flown)=&lt;/xsl:text&gt;
    &lt;xsl:value-of select="number(//miles-flown)"/&gt;
    &lt;xsl:value-of select="$newline"/&gt;
    &lt;xsl:text&gt;   number(/report/title)=&lt;/xsl:text&gt;
    &lt;xsl:value-of select="number(/report/title)"/&gt;
  &lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;</pre></span>
<p>X^CV[g̏o͎͂̂ƂłB</p>
<span class="PROGRAMLISTING"><pre>

Tests of the number() function:

   number(true())=1
   number(false())=0
   number(/report/month[2]/miles-flown)=32857
   number(//miles-flown)=12379
   number(/report/title)=NaN
</pre></span>
</td>
</tr>
</table>
</div>
</body>
</html>
