Extension functions
Saxon-CE defines a number of functions in the namespace
http://saxonica.com/ns/interactiveXSLT
, conventional prefix ixsl
.
Function |
Effect |
ixsl:page() |
Returns the document node of the HTML DOM document. The result is both a node and a
JavaScript object. So, for example, the title of the current document is accessible as
|
ixsl:source() |
Returns the document node of the source XML document. Useful for retrieving the source document from within a user-event template as the context item wll be that of the host HTML page. |
ixsl:window() |
Returns the Window object. This is a JavaScript object: it is possible to get its properties
using |
ixsl:event() |
Returns the current Event object while processing a user input event (or the empty sequence
otherwise). This is a JavaScript object: it is possible to get its properties using
|
ixsl:get( $object, $property ) |
Gets a property of a JavaScript object (which may be an object returned by another extension
function, or a node in the HTML DOM). The |
ixsl:call( $object, $method, $arguments... ) |
Calls a JavaScript function. The first argument is the object on which the function is
defined (use |
ixsl:eval($script) |
Executes Javascript code, supplied as a string. The supplied |
Global JavaScript functions (those belonging to the global Window object) can also be called
directly. For example if a function has been declared as
<script type="text/javascript" language="javascript"> function square(x) { return String(x*x) }</script>
then it can be called from within an XPath expression as js:square('5')
where
js
is bound to the namespace http://saxonica.com/ns/globalJS
.