# Extensions

An optional second argument is available for `saxon:expression()`. This allows the namespace context for the XPath expression to be supplied explicitly (by default, it is taken from the namespace context of the calling query or stylesheet). The namespace context is supplied in the form of an element node, whose in-scope namespace bindings are used to declare namespace prefixes available for use within the expression. One way to use this is to supply the element node that actually contains the XPath expression; another way is to construct an element specially for the purpose.

A new extension function `saxon:in-summer-time()` is available. It determines whether a given date/time is in summer time (daylight savings time) in a given country or named timezone, to the extent that this information is available in the Java timezone database.

Saxon's support for XOM is extended: there is now a `net.sf.saxon.xom.XOMWriter` class that allows the output of a query or transformation to be captured directly in the form of a XOM document. The class implements `Receiver` and `Result`; an instance of this class can therefore be used directly as an argument to the JAXP `Transformer.transform()` method or the `XQueryExpression.run()` method.

A new extension function `saxon:unparsed-entities()` is available, allowing the application to obtain a list of the names of the unparsed entities declared in a document.

The elements in the SQL extension now by default use the namespace `xmlns:sql="http://saxon.sf.net/sql"`. They can however be registered under a different namespace if required. The extension is not available unless it is registered with the Configuration, either using the API `Configuration.setExtensionElementNamespace()`, or using a configuration file. Either way, Saxon-PE or higher is required (although the extension itself is open source code).

The implementation of the `sql:insert` and `sql:update` extension instructions has been simplified. This may result in some error conditions being detected that were not detected before. The names of tables and columns supplied to these instructions are now validated against SQL rules; if the names are not valid against SQL rules and are not already quoted then they will be enclosed in double-quotation marks.

The `saxon:path()` extension function now accepts a node as an argument. Previously it worked only on the context node.

Next