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

Transformiix: Elements and Functions Available

XSLT 1.0, http://www.mozilla.org/projects/xslt/

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 true XPath
2 ceiling true XPath
3 concat true XPath
4 contains true XPath
5 count true XPath
6 current true XSLT
7 document true XSLT
8 element-available true XSLT
9 false true XPath
10 format-number true XSLT
11 function-available true XSLT
12 generate-id true XSLT
13 id true XPath
14 key true XSLT
15 lang true XPath
16 last true XPath
17 local-name true XPath
18 name true XPath
19 namespace-uri true XPath
20 normalize-space true XPath
21 not true XPath
22 number true XPath
23 position true XPath
24 round true XPath
25 starts-with true XPath
26 string true XPath
27 string-length true XPath
28 substring true XPath
29 substring-after true XPath
30 substring-before true XPath
31 sum true XPath
32 system-property true XSLT
33 translate true XPath
34 true true 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 true (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 true (not instruction)
11 xsl:element true
12 xsl:fallback true
13 xsl:for-each true
14 xsl:if true
15 xsl:import true (not instruction)
16 xsl:include true (not instruction)
17 xsl:key true (not instruction)
18 xsl:message true
19 xsl:namespace-alias false (not instruction)
20 xsl:number true
21 xsl:otherwise true (not instruction)
22 xsl:output true (not instruction)
23 xsl:param true (not instruction)
24 xsl:preserve-space true (not instruction)
25 xsl:processing-instruction true
26 xsl:sort true (not instruction)
27 xsl:strip-space true (not instruction)
28 xsl:stylesheet true (not instruction)
29 xsl:template true (not instruction)
30 xsl:text true
31 xsl:transform true (not instruction)
32 xsl:value-of true
33 xsl:variable true
34 xsl:when true (not instruction)
35 xsl:with-param true (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 false
4 date:date-time false
5 date:day-abbreviation false
6 date:day-in-month false
7 date:day-in-week false
8 date:day-in-year false
9 date:day-name false
10 date:day-of-week-in-month false
11 date:difference false
12 date:duration false
13 date:format-date false
14 date:hour-in-day false
15 date:leap-year false
16 date:minute-in-hour false
17 date:month-abbreviation false
18 date:month-in-year false
19 date:month-name false
20 date:parse-date false
21 date:second-in-minute false
22 date:seconds false
23 date:sum false
24 date:time false
25 date:week-in-month false
26 date:week-in-year false
27 date:year false

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 false
2 math:acos false
3 math:asin false
4 math:atan false
5 math:atan2 false
6 math:constant false
7 math:cos false
8 math:exp false
9 math:highest true
10 math:log false
11 math:lowest true
12 math:max true
13 math:min true
14 math:power false
15 math:random false
16 math:sin false
17 math:sqrt false
18 math:tan false

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 true
3 str:decode-uri false
4 str:encode-uri false
5 str:padding false
6 str:replace false
7 str:split true
8 str:tokenize true

END