<html>
<head>
<title>sum() ֐</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">sum() ֐</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[^m[hZbĝׂẴm[h𐔒lɕϊA̐l̍vԂ܂Bm[hZbĝꂩ̃m[h𐔒lɕϊłȂꍇ ( <span class="LITERAL">number()</span> ֐ɓn <span class="LITERAL">NaN</span> Ԃ܂)A<span class="LITERAL">sum()</span> ֐ <span class="LITERAL">NaN</span> Ԃ܂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>m[hZbgBm[hZbgŐlłȂm[h́A<span class="LITERAL">number()</span> ֐ɓnꂽ̂悤ɐlɕϊAׂẴm[h̐lv܂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>p[^m[hZbĝׂẴm[h̐l̍vBp[^m[hZbĝꂩ̃m[h𐔒lɕϊłȂꍇA<span class="LITERAL">sum()</span> ֐ <span class="LITERAL">NaN</span> Ԃ܂B</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>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> XML hLgɑ΂ <span class="LITERAL">sum()</span> ֐̋@\܂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>
<!--<?troff .Nd 10?>-->
<p><span class="LITERAL">sum()</span> ֐gpX^CV[gɎ܂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;

  &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;A test of the sum() function:&lt;/xsl:text&gt;

    &lt;xsl:value-of select="$newline"/&gt;
    &lt;xsl:value-of select="$newline"/&gt;
    &lt;xsl:text&gt;Total miles flown this year:  &lt;/xsl:text&gt;
    &lt;xsl:value-of 
      select="format-number(sum(/report/month/miles-flown), '###,###')"/&gt;
    &lt;xsl:value-of select="$newline"/&gt;
    &lt;xsl:value-of select="$newline"/&gt;
    &lt;xsl:text&gt;Total miles earned this year: &lt;/xsl:text&gt;
    &lt;xsl:value-of 
      select="format-number(sum(/report/month/miles-earned), '###,###')"/&gt;
    &lt;xsl:value-of select="$newline"/&gt;
    &lt;xsl:value-of select="$newline"/&gt;
  &lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;</pre></span>
<p>̃X^CV[ggp XML hLgƁǍʂ܂B</p>
<span class="PROGRAMLISTING"><pre>

A test of the sum() function:

Total miles flown this year:  84,059

Total miles earned this year: 236,452
</pre></span>
</td>
</tr>
</table>
</div>
</body>
</html>
