XSLT Functions
XSLT extension functions can be used in XPath expressions in an XSLT context. They will not work in a non-XSLT context (for instance, in an XQuery context).
Note about naming of functions and language applicability
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, https://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.
|
General functions
altova:distinct-nodes(node()*) as node()* XSLT1 XSLT2 XSLT3 Takes a set of one or more nodes as its input and returns the same set minus nodes with duplicate values. The comparison is done using the XPath/XQuery function fn:deep-equal.
|
altova:evaluate(XPathExpression as xs:string[, ValueOf\$p1, ... ValueOf\$pN]) XSLT1 XSLT2 XSLT3 Takes an XPath expression, passed as a string, as its mandatory argument. It returns the output of the evaluated expression. For example: altova:evaluate('//Name[1]') returns the contents of the first Name element in the document. Note that the expression //Name[1] is passed as a string by enclosing it in single quotes.
The altova:evaluate function can optionally take additional arguments. These arguments are the values of in-scope variables that have the names p1, p2, p3... pN. Note the following points about usage: (i) The variables must be defined with names of the form pX, where X is an integer; (ii) the altova:evaluate function's arguments (see signature above), from the second argument onwards, provide the values of the variables, with the sequence of the arguments corresponding to the numerically ordered sequence of variables: p1 to pN: The second argument will be the value of the variable p1, the third argument that of the variable p2, and so on; (iii) The variable values must be of type item*.
The altova:evaluate() extension function is useful in situations where an XPath expression in the XSLT stylesheet contains one or more parts that must be evaluated dynamically. For example, consider a situation in which a user enters his request for the sorting criterion and this criterion is stored in the attribute UserReq/@sortkey. In the stylesheet, you could then have the expression: <xsl:sort select="altova:evaluate(../UserReq/@sortkey)" order="ascending"/>. The altova:evaluate() function reads the sortkey attribute of the UserReq child element of the parent of the context node. Say the value of the sortkey attribute is Price, then Price is returned by the altova:evaluate() function and becomes the value of the select attribute: <xsl:sort select="Price" order="ascending"/>. If this sort instruction occurs within the context of an element called Order, then the Order elements will be sorted according to the values of their Price children. Alternatively, if the value of @sortkey were, say, Date, then the Order elements would be sorted according to the values of their Date children. So the sort criterion for Order is selected from the sortkey attribute at runtime. This could not have been achieved with an expression like: <xsl:sort select="../UserReq/@sortkey" order="ascending"/>. In the case shown above, the sort criterion would be the sortkey attribute itself, not Price or Date (or any other current content of sortkey).
|
altova:encode-for-rtf(input as xs:string, preserveallwhitespace as xs:boolean, preservenewlines as xs:boolean) as xs:string XSLT2 XSLT3 Converts the input string into code for RTF. Whitespace and new lines will be preserved according to the boolean value specified for their respective arguments.
|
[ Top ]
XBRL functions
Altova XBRL functions can be used only with editions of Altova products that have XBRL support.
altova:xbrl-footnotes(node()) as node()* XSLT2 XSLT3 Takes a node as its input argument and returns the set of XBRL footnote nodes referenced by the input node.
|
altova:xbrl-labels(xs:QName, xs:string) as node()* XSLT2 XSLT3 Takes two input arguments: a node name and the taxonomy file location containing the node. The function returns the XBRL label nodes associated with the input node.
|
[ Top ]