Report based on element-function-available.xsl
Report generated 2008-10-21

SAXON 6.5.5 from Michael Kay: Elements and Functions Available

XSLT 1.0, http://saxon.sf.net/

1. The XSLT stylesheet behind the report

With the help of the XSLT functions element-available() and function-available(), the XSLT stylesheet, element-function-available.xsl, tests:

  1. If instruction elements in XSLT and functions in XSLT and XPath are available in the XSLT processor.

  2. If EXSLT extensions are available.

  3. If proprietary Saxon extension instruction elements and functions are available in Saxon processors.

Note that:

2. XSLT and XPath

2.1 XSLT/XPath 1.0 Functions

We can use function-available() to test if an XSLT or XPath function or even an extension function is available in an XSLT processor. Right below we test for XSLT/XPath functions, later we are going to test for extension function.

No XSLT/XPath Function Available Spec
1 boolean false XPath
2 ceiling false XPath
3 concat false XPath
4 contains false XPath
5 count false XPath
6 current false XSLT
7 document false XSLT
8 element-available false XSLT
9 false false XPath
10 format-number false XSLT
11 function-available false XSLT
12 generate-id false XSLT
13 id false XPath
14 key false XSLT
15 lang false XPath
16 last false XPath
17 local-name false XPath
18 name false XPath
19 namespace-uri false XPath
20 normalize-space false XPath
21 not false XPath
22 number false XPath
23 position false XPath
24 round false XPath
25 starts-with false XPath
26 string false XPath
27 string-length false XPath
28 substring false XPath
29 substring-after false XPath
30 substring-before false XPath
31 sum false XPath
32 system-property false XSLT
33 translate false XPath
34 true false XPath
35 unparsed-entity-uri false XSLT

2.2 XSLT Elements

The XSLTstandards (Recommendations) say (2.0 more clearly than 1.0) that element-available() is about instruction elements. This means that non-instruction elements like declaration elements, e.g. xsl:strip-space and xsl:output, and sub-elements of instruction elements like xsl:when and xsl:sort can't be tested with element-available(). It is very confusing that non-instruction elements return "false" as if they don't exist.

Some XSLT processors like AltovaXML 2008 and MSXML 3.0 return true for all implemented elements. XMLSpy 2008 returns true for all elements except for xsl:strip-space (not implemented) and xsl-preserve-space (not implemented) and xsl:transform (implemented). The last one must be a bug. Element-available()would be more useful and less confusing if also Saxon returned "true" for any element implemented.

2.2.1 Warning

If element-available() returns "false" for all non-instruction elements, the "false" will be high-lighted with red but the elements are probably supported anyway. The "false" for non-instruction elements most often just means that the element is not an instruction element. If only some of the non-instruction elements return "false", as in AltovaXML, they are probably not available.

If an instruction-element returns "false", we always have a real problem.

No XSLT Element Available
1 xsl:apply-imports true
2 xsl:apply-templates true
3 xsl:attribute true
4 xsl:attribute-set false (not instruction)
5 xsl:call-template true
6 xsl:choose true
7 xsl:comment true
8 xsl:copy true
9 xsl:copy-of true
10 xsl:decimal-format false (not instruction)
11 xsl:element true
12 xsl:fallback true
13 xsl:for-each true
14 xsl:if true
15 xsl:import false (not instruction)
16 xsl:include false (not instruction)
17 xsl:key false (not instruction)
18 xsl:message true
19 xsl:namespace-alias false (not instruction)
20 xsl:number true
21 xsl:otherwise false (not instruction)
22 xsl:output false (not instruction)
23 xsl:param false (not instruction)
24 xsl:preserve-space false (not instruction)
25 xsl:processing-instruction true
26 xsl:sort false (not instruction)
27 xsl:strip-space false (not instruction)
28 xsl:stylesheet false (not instruction)
29 xsl:template false (not instruction)
30 xsl:text true
31 xsl:transform false (not instruction)
32 xsl:value-of true
33 xsl:variable true
34 xsl:when false (not instruction)
35 xsl:with-param false (not instruction)

3. User-defined XSLT functions

Before we continue with extension elements and functions, let us not forget user-defined XSLT functions. That is collections of functions using named templates, the xsl:function element in XSLT 2.0, etc., and based on standard XSLT functionality.

Here is a list of some collections of user-defined XSLT-functions:

  1. Priscilla Walmsley's The FunctX XSLT 2.0 Function Library. Here we have many small examples of how to use XSLT/XPath functions and additional user-defined functions using the "functx" prefix.

  2. Peter Rushforth's Geofunctions, an open-source library of XSLT / functions, templates, stylesheets and classes devoted to the processing of geographic data in XML.

  3. Dimitre Novatchev's FXSL, "the functional programming library for XSLT".

  4. Xia Li's function library that enables applications to use XPath 2.0 schema-related node tests.

4. Saxon Extensions

Saxon's extensions are not necessarily relevant for Saxon only. If you use another XSLT processor, it can be nice to know what extensions are available in the trendsetting Saxon XSLT 2.0 processor. It can give you a hint for what to look or ask for in the XSLT processor you use. If some new XSLT 2.0 processor needs extensions, why not implement Saxon's?

A few of Saxon's extensions are only available in the "SA" (schema-aware) version.

4.1 Saxon Extension Functions

Many of Saxon's extension functions are unique, adding functionality to XSLT.2.0

No Saxon Function Available
1 saxon:analyze-string false
2 saxon:base64Binary-to-octets false
3 saxon:base64Binary-to-string false
4 saxon:call false
5 saxon:column-number false
6 saxon:compile-query false
7 saxon:compile-stylesheet false
8 saxon:decimal-divide false
9 saxon:deep-equal false
10 saxon:discard-document false
11 saxon:eval false
12 saxon:evaluate false
13 saxon:evaluate-node false
14 saxon:expression false
15 saxon:file-last-modified false
16 saxon:find false
17 saxon:for-each-group false
18 saxon:format-dateTime false
19 saxon:format-number false
20 saxon:function false
21 saxon:generate-id false
22 saxon:get-pseudo-attribute false
23 saxon:has-same-nodes false
24 saxon:hexBinary-to-octets false
25 saxon:hexBinary-to-string false
26 saxon:highest false
27 saxon:index false
28 saxon:in-summer-time false
29 saxon:is-whole-number false
30 saxon:item-at false
31 saxon:last-modified false
32 saxon:leading false
33 saxon:line-number false
34 saxon:lowest false
35 saxon:namespace-node false
36 saxon:stream false
37 saxon:octets-to-base64Binary false
38 saxon:octets-to-hexBinary false
39 saxon:parse false
40 saxon:path false
41 saxon:print-stack false
42 saxon:query false
43 saxon:result-document false
44 saxon:serialize false
45 saxon:sort false
46 saxon:string-to-base64Binary false
47 saxon:string-to-hexBinary false
48 saxon:string-to-utf8 false
49 saxon:system-id false
50 saxon:transform false
51 saxon:try false
52 saxon:type-annotation false
53 saxon:unparsed-entities false

4.2 Saxon Extension Elements

Many of Saxon's extension elements are unique, adding functionality to XSLT.2.0

No Saxon Element Available
1 saxon:assign false
2 saxon:break false (not instruction)
3 saxon:call-template false
4 saxon:collation false (not instruction)
5 saxon:doctype false
6 saxon:entity-ref false
7 saxon:import-query false (not instruction)
8 saxon:iterate false (not instruction)
9 saxon:script false (not instruction)
10 saxon:while false

5. EXSLT Extensions

EXSLT is a community initiative to provide extensions to XSLT. This was needed for XSLT 1.0 having limited functionality and very few functions. Almost anything in EXSLT made it into XSLT 2.0 making EXSLT less relevant today with few exceptions like the math functions. EXSLT is still a necessity if we must make stylesheets that work both in XSLT 2.0 processors an in XSLT 1.0 processors.

5.1 EXSL Dates and Times Functions

Except for date:parse-date() the functions in EXSLT DATES AND TIMES are irrelevant in XSLT 2.0 having similar functions. If we need to make stylesheets that work both in XSLT 2.0 and in XSLT 1.0, EXSL extensions can some times help us out if supported in older XSLT processors.

No EXSL Function Available
1 date:add false
2 date:add-duration false
3 date:date true
4 date:date-time true
5 date:day-abbreviation true
6 date:day-in-month true
7 date:day-in-week true
8 date:day-in-year true
9 date:day-name true
10 date:day-of-week-in-month true
11 date:difference false
12 date:duration false
13 date:format-date false
14 date:hour-in-day true
15 date:leap-year true
16 date:minute-in-hour true
17 date:month-abbreviation true
18 date:month-in-year true
19 date:month-name true
20 date:parse-date false
21 date:second-in-minute true
22 date:seconds false
23 date:sum false
24 date:time true
25 date:week-in-month true
26 date:week-in-year true
27 date:year true

5.2 EXSL Dates and Times Elements

Extension element in EXSLT DATES AND TIMES is irrelevant in XSLT 2.0 having a similar element.

No EXSL Element Available
1 date:date-format false (not instruction)

5.3 EXSL Dynamic Functions

Except for dyn:evaluate() the functions in EXSLT - DYNAMIC are irrelevant in XSLT/XPath 2.0 having similar functions. Saxon has a better and more complete set of "evaluate" functions. "Evaluate" makes it possible to create XPath expressions dynamically. Expressions in pure XPath can not be created dynamically except that predicates can contain variables.

No EXSL Function Available
1 dyn:closure false
2 dyn:evaluate false
3 dyn:map false
4 dyn:max false
5 dyn:min false
6 dyn:sum false

5.4 EXSL Common Functions

Functions in EXSLT Common are irrelevant in XSLT/XPath 2.0 having similar functions.

No EXSL Function Available
1 exsl:node-set true
2 exsl:object-type true

5.5 EXSL Common Elements

Elements in EXSLT Common are irrelevant in XSLT 2.0 having similar elements.

No EXSL Element Available
1 exsl:document false

5.6 EXSL Functions Elements

Elements in EXSLT Functions are irrelevant in XSLT/XPath 2.0 having similar elements.

No EXSL Element Available
1 func:function false (not instruction)
2 func:result false
3 func:script false (not instruction)

5.7 EXSL Math Functions

Most of the functions in EXSLT Math are still very relevant in XSLT 2.0.

No EXSL Function Available
1 math:abs true
2 math:acos true
3 math:asin true
4 math:atan true
5 math:atan2 true
6 math:constant true
7 math:cos true
8 math:exp true
9 math:highest true
10 math:log true
11 math:lowest true
12 math:max true
13 math:min true
14 math:power true
15 math:random true
16 math:sin true
17 math:sqrt true
18 math:tan true

5.8 EXSL Random Functions

The random() function in EXSLT Random is still relevant in XSLT 2.0.

No EXSL Function Available
1 random:random-sequence false

5.9 EXSL Regular Expressions Functions

Functions in EXSLT Regular Expressions are irrelevant in XSLT/XPath 2.0 having similar functionality.

No EXSL Function Available
1 regexp:match false
2 regexp:replace false
3 regexp:test false

5.10 EXSL Sets Functions

Functions in EXSLT Sets are irrelevant in XSLT/XPath 2.0 having similar functionality.

No EXSL Function Available
1 set:difference true
2 set:distinct true
3 set:has-same-node true
4 set:intersection true
5 set:leading true
6 set:trailing true

5.11 EXSL String Functions

Functions in EXSLT Strings are irrelevant in XSLT 2.0 having similar functionality.

No EXSL Function Available
1 str:align false
2 str:concat false
3 str:decode-uri false
4 str:encode-uri false
5 str:padding false
6 str:replace false
7 str:split false
8 str:tokenize false

END