Sophie

Sophie

distrib > Mageia > 7 > x86_64 > by-pkgid > b3bdfe6d859a3d6920ff2c44b38e9a6f > files > 60

saxon-manual-9.4.0.9-2.mga7.noarch.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="../../make-menu.xsl" type="text/xsl"?><html>
   <head>
      <this-is section="changes" page="intro92" subpage="extensions92"/>
      <!--
           Generated at 2011-12-09T20:47:22.916Z--><title>Saxonica: XSLT and XQuery Processing: Extensions</title>
      <meta name="coverage" content="Worldwide"/>
      <meta name="copyright" content="Copyright Saxonica Ltd"/>
      <meta name="title" content="Saxonica: XSLT and XQuery Processing: Extensions"/>
      <meta name="robots" content="noindex,nofollow"/>
      <link rel="stylesheet" href="../../saxondocs.css" type="text/css"/>
   </head>
   <body class="main">
      <h1>Extensions</h1>
      <p>A new extension function <code>saxon:adjust-to-civil-time()</code> is available. This adjusts a date/time value
to its equivalent in the civil time of a named timezone, taking account of summer time (daylight savings time) changes. 
For example 
<code>adjust-to-civil-time(xs:dateTime('2008-07-10T12:00:00Z', 'America/New_York')</code>
returns <code>2008-07-10T08:00:00-04:00</code></p>
      <p>Two new XSLT extension instructions are available (in Saxon-EE only): <code>&lt;saxon:try&gt;</code> and 
<code>&lt;saxon:catch&gt;</code>. These complement the existing <code>saxon:try()</code> extension function, but
are more powerful, and more convenient in many cases because they catch errors at the XSLT level.
For details see <a class="bodylink" href="../../extensions/instructions/try-instr.xml">saxon:try</a>.</p>
      <p>A new extension function <code>saxon:parse-html()</code> is available. This works in the same way
as <code>saxon:parse()</code>, but it assumes the input is HTML rather than XML. The TagSoup parser must
be available on the classpath for this to work.</p>
      <p>The extension functions <code>saxon:file-last-modified()</code> and <code>saxon:last-modified()</code>
have been changed. There is now only one function, <code>saxon:last-modified()</code>, and it takes a URI as its
argument. It can now be a relative or absolute URI (if relative, it is resolved against the base URI from the
static context). To get the last-modified date of the file from which a particular node was loaded, use
<code>saxon:last-modified(document-uri(/))</code>. The function now throws a dynamic error if given an
invalid URI or a URI that cannot be resolved or dereferenced; this can be caught using try/catch if needed.
The function returns an empty sequence if the resource can be retrieved but no date/time is available.</p>
      <p>In the <code>saxon:try()</code> extension function, the ability to supply a function as the second
parameter (to be called if evaluation of the first parameter fails) is withdrawn. The second argument is now
always evaluated directly.</p>
      <p>The support for the EXSLT date-and-time library has been updated. Some new methods are available
(add(), difference(), seconds(), duration(), sum()), and implementations of existing functions have been upgraded to conform
more closely to the spec, in particular by checking for erroneous input. One change that may be noticed is that
the function <code>date()</code>, with no arguments, now returns the current date with a timezone.</p>
      <p>The extension function <code>saxon:function()</code> has changed so the argument can now be a system function
 as well as a user-defined function. If the function name is unprefixed, it is now assumed to be in the default
 function namespace.</p>
      <p>The extension functions <code>saxon:highest()</code>, <code>saxon:lowest()</code>, <code>saxon:sort()</code>,
 and <code>saxon:leading()</code>
have been reworked to take advantage of higher-order functions. The second argument (if present) is now a function
item rather than a dynamic expression.</p>
      <p>The extension function <code>saxon:after()</code>, which has been undocumented for many years, is finally
dropped from the code.</p>
      <p>The extension functions <code>saxon:index()</code> and <code>saxon:find()</code> now impose the same comparison rules
as value comparisons: for example, if the value indexed is untyped atomic, then supplying an integer as the argument to
<code>saxon:find()</code>results in a type error. Previously, it resulted in a "no match" (typically, <code>saxon:find()</code>
returned an empty sequence).</p>
      <p>The extension function <code>saxon:type-annotation()</code>, when applied to a document node, now returns <code>xs:anyType</code>
if the document has been schema-validated, or <code>xs:untyped</code> otherwise. Previously it return <code>xs:untypedAtomic</code>.
For comment, processing-instruction, and namespace nodes it now returns <code>xs:string</code>.</p>
      <p>The XSLT extension instruction <code>saxon:script</code> is dropped. It suffered a major design problem: the bindings it declared were
global (applying to a Configuration as a whole, and in part to all Configurations in the Java VM, rather than to a particular 
stylesheet), and the cost of fixing this problem would not be justified by the level of usage of this legacy feature. 
Equivalent facilities are now available via the configuration file, or using the Configuration API.</p>
      <table width="100%">
         <tr>
            <td>
               <p align="right"><a class="nav" href="optimization92.xml">Next</a></p>
            </td>
         </tr>
      </table>
   </body>
</html>