<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="../make-menu.xsl" type="text/xsl"?><html>
   <head>
      <this-is section="extensions" page="exslt" subpage=""/>
      <!--
           Generated at 2011-12-09T20:47:22.916Z--><title>Saxonica: XSLT and XQuery Processing: EXSLT Extensions</title>
      <meta name="coverage" content="Worldwide"/>
      <meta name="copyright" content="Copyright Saxonica Ltd"/>
      <meta name="title" content="Saxonica: XSLT and XQuery Processing: EXSLT Extensions"/>
      <meta name="robots" content="noindex,nofollow"/>
      <link rel="stylesheet" href="../saxondocs.css" type="text/css"/>
   </head>
   <body class="main">
      <h1>EXSLT Extensions</h1>
      <p><a href="http://www.exslt.org/" class="bodylink">EXSLT</a> is
 an initiative to define a standardized set of extension functions 
and extension elements that can be used across different XSLT processors.</p>
      <p>Saxon supports the EXSLT modules Common, Math, Sets, DatesAndTimes, and Random. 
These functions are available both in XSLT and in XQuery. The full list
of EXSLT extension functions implemented is:</p>
      <ul>
         <li content="para">
            <p>
            <b>common (namespace http://exslt.org/common):</b> node-set(), object-type()</p>
         </li>
         <li content="para">
            <p>
            <b>math (namespace http://exslt.org/math):</b> abs(), acos(), asin(), atan(), atan2(),
constant(), cos(), exp(), highest(), log(), lowest(), max(), min(), power() <i>[see below]</i>, random(),
 sin(), sqrt(), tan(). <i>The <code>random()</code> function is also implemented, but it doesn't work
 well: since it is not a pure function, Saxon sometimes optimizes it so that successive
 calls all return the same value. The random:random-sequence() function is preferable.</i>
         </p>
         </li>
         <li content="para">
            <p>
            <b>sets (namespace http://exslt.org/sets):</b> difference(), intersection(), leading(), trailing(), has-same-node()</p>
         </li>
         <li content="para">
            <p>
            <b>dates-and-times (namespace http://exslt.org/dates-and-times):</b>
add(), add-duration(), date(), date-time(), day-abbreviation(), day-in-month(), day-in-week(), day-in-year(), day-name(), 
day-of-week-in-month(), difference(), duration(), hour-in-day(), leap-year(), minute-in-hour(), month-abbreviation(), 
month-in-year(), month-name(), second-in-minute(), seconds(), sum(), time(), week-in-month(), week-in-year(), year().</p>
         </li>
         <li content="para">
            <p>
            <b>random (namespace http://exslt.org/random):</b> random-sequence()</p>
         </li>
      </ul>
      <p><i>These extensions are available in Saxon-PE and Saxon-EE "out of the box". They are not available in Saxon-HE.
The source code is available in the saxon-resources download, package <code>net.sf.saxon.option.exslt</code>. The code
is available under the Mozilla Public License.</i></p>
      <p>There are some known restrictions and local interpretations:</p>
      <ul>
         <li content="para">
            <p>In the <code>set:leading()</code> and <code>set:trailing()</code> functions, 
Saxon does not implement the rule 
"If the first node in the second node set is not contained in the first node set, 
then an empty node set is returned." This rule prevents a pipelined implementation. Saxon returns
all nodes that precede/follow the first/last node of the second node-set in document order, whether
or not the two node-sets intersect.</p>
         </li>
      </ul>
      <p>EXSLT extensions that overlap XSLT 2.0 functionality have sometimes been retained in cases where they have no
impact on the Saxon core code, but in cases (such as <code>func:function</code>) where the semantics are
inconveniently different from XSLT 2.0, they have been withdrawn.</p>
      <p>The function <code>math:power()</code> has been extended from the EXSLT definition to handle numeric data
types other than xs:double. The result will now be an xs:integer if the first argument is an xs:integer and
the second argument is a non-negative xs:integer. Otherwise, the result will be an xs:decimal if the first argument is
an xs:decimal or xs:integer, and the second argument is a whole number (a number of any data type that is equal
to some integer). In other cases the arguments are converted to xs:double and the result is an xs:double.</p>
      <p>The specifications of the EXSLT date-and-time handling functions have little to say about timezones. Saxon generally
handles inputs with or without a timezone, and uses the XPath 2.0 concept of implicit timezone to interpret the meaning
of dates/times without a timezone. The current date and time used by EXSLT functions is the same as that used by the
XPath 2.0 current-dateTime() function.</p>
      <table width="100%">
         <tr>
            <td>
               <p align="right"><a class="nav" href="attributes.xml">Next</a></p>
            </td>
         </tr>
      </table>
   </body>
</html>