Altova XMLSpy 2024 Professional Edition

Altova extension functions can be used in XPath/XQuery expressions. They provide additional functionality to the functionality that is available in the standard library of XPath, XQuery, and XSLT functions. Altova extension functions are in the Altova extension functions namespace, http://www.altova.com/xslt-extensions, and are indicated in this section with the prefix altova:, which is assumed to be bound to this namespace. Note that, in future versions of your product, support for a function might be discontinued or the behavior of individual functions might change. Consult the documentation of future releases for information about support for Altova extension functions in that release.

 

 

Functions defined in the W3C's XPath/XQuery Functions specifications can be used in: (i) XPath expressions in an XSLT context, and (ii) in XQuery expressions in an XQuery document. In this documentation we indicate the functions that can be used in the former context (XPath in XSLT) with an XP symbol and call them XPath functions; those functions that can be used in the latter (XQuery) context are indicated with an XQ symbol; they work as XQuery functions. The W3C's XSLT specifications—not XPath/XQuery Functions specifications—also define functions that can be used in XPath expressions in XSLT documents. These functions are marked with an XSLT symbol and are called XSLT functions. The XPath/XQuery and XSLT versions in which a function can be used are indicated in the description of the function (see symbols below). Functions from the XPath/XQuery and XSLT function libraries are listed without a prefix. Extension functions from other libraries, such as Altova extension functions, are listed with a prefix.

 

 

XPath functions (used in XPath expressions in XSLT):

XP1 XP2 XP3.1

XSLT functions (used in XPath expressions in XSLT):

XSLT1 XSLT2 XSLT3

XQuery functions (used in XQuery expressions in XQuery):

XQ1 XQ3.1

 

Usage of Altova extension functions

In order to use Altova extension functions, you must declare the Altova extension functions namespace (first highlight in code listing below) and then use the extension functions so that they are resolved as belonging to this namespace (see second highlight). The example below uses the Altova extension function named age.

 

<xsl:stylesheet version="2.0"

xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

xmlns:xs="http://www.w3.org/2001/XMLSchema"

xmlns:fn="http://www.w3.org/2005/xpath-functions"

xmlns:altova="http://www.altova.com/xslt-extensions">

<xsl:output method="text" encoding="ISO-8859-1"/>

<xsl:template match="Persons">

<xsl:for-each select="Person">

  <xsl:value-of select="concat(Name, ': ')"/>

  <xsl:value-of select="altova:age(xs:date(BirthDate))"/>

  <xsl:value-of select="' years&#x0A;'"/>

</xsl:for-each>

</xsl:template>

</xsl:stylesheet>

 

 

XSLT functions

XSLT functions can only be used in XPath expressions in an XSLT context (similarly to XSLT 2.0's current-group() or key() functions). These functions are not intended for, and will not work in, a non-XSLT context (for instance, in an XQuery context). Note that XSLT functions for XBRL can be used only with editions of Altova products that have XBRL support.

 

XPath/XQuery functions

XPath/XQuery functions can be used both in XPath expressions in XSLT contexts as well as in XQuery expressions:

 

Date/Time

Geolocation

Image-related

Numeric

Sequence

String

Miscellaneous

 

© 2017-2023 Altova GmbH