Report based on element-function-available.xsl
Report generated 2008-10-21
XSLT 2.0. Schema-aware: no. Gobo, http://www.gobosoft.com/
With the help of the XSLT functions element-available() and
function-available(), the XSLT stylesheet, element-function-available.xsl, tests:
If instruction elements in XSLT and functions in XSLT and XPath are available in the XSLT processor.
If EXSLT extensions are available.
If proprietary Saxon extension instruction elements and functions are available in Saxon processors.
Note that:
AltovaXML supports no extensions of any kind. If the transformation takes place from inside an ordinary programming language the parameter method can help AltovaXML out.
Many XSLT 1.0 processors have their own proprietary sets of extensions which I am not testing. We test for Saxon extensions because of the importance of Saxon in XSLT 2.0.
There are other extensions than elements and functions which we can't
test with element-available() and
function-available(). Saxon extensions, e.g., include a few extension attributes and
additional serialization parameters.
If an XSLT processor has a "script" extension element, often named "prefix:script", the programming languages supported can be used from inside the XSLT stylesheet. This makes it easy to use the functions of those programming languages when needed.
In e.g. Saxon, it is fairly easy to make additional extension functions in Java or .Net. Example: XSLT 2.0 extensions for Saxon made by Florent Georges.
We are only testing what the processor reports. We must use the element and function for real to see if it really is implemented or not and if the implementation is in accordance with the specs.
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 | abs | true | XPath |
| 2 | adjust-date-to-timezone | true | XPath |
| 3 | adjust-dateTime-to-timezone | true | XPath |
| 4 | adjust-time-to-timezone | true | XPath |
| 5 | avg | true | XPath |
| 6 | base-uri | true | XPath |
| 7 | boolean | true | XPath |
| 8 | ceiling | true | XPath |
| 9 | codepoint-equal | true | XPath |
| 10 | codepoints-to-string | true | XPath |
| 11 | collection | true | XPath |
| 12 | compare | true | XPath |
| 13 | concat | true | XPath |
| 14 | contains | true | XPath |
| 15 | count | true | XPath |
| 16 | current | true | XSLT |
| 17 | current-date | true | XPath |
| 18 | current-dateTime | true | XPath |
| 19 | current-group | true | XSLT |
| 20 | current-grouping-key | true | XSLT |
| 21 | current-time | true | XPath |
| 22 | data | true | XPath |
| 23 | dateTime | false | XPath |
| 24 | day-from-date | true | XPath |
| 25 | day-from-dateTime | true | XPath |
| 26 | days-from-duration | true | XPath |
| 27 | deep-equal | true | XPath |
| 28 | default-collation | true | XPath |
| 29 | distinct-values | true | XPath |
| 30 | doc | true | XPath |
| 31 | doc-available | true | XPath |
| 32 | document | true | XSLT |
| 33 | document-uri | true | XPath |
| 34 | element-available | true | XSLT |
| 35 | empty | true | XPath |
| 36 | encode-for-uri | true | XPath |
| 37 | ends-with | true | XPath |
| 38 | error | true | XPath |
| 39 | escape-html-uri | true | XPath |
| 40 | exactly-one | true | XPath |
| 41 | exists | true | XPath |
| 42 | false | true | XPath |
| 43 | floor | true | XPath |
| 44 | format-date | true | XSLT |
| 45 | format-dateTime | true | XSLT |
| 46 | format-number | true | XSLT |
| 47 | format-time | true | XSLT |
| 48 | function-available | true | XSLT |
| 49 | generate-id | true | XSLT |
| 50 | hours-from-dateTime | true | XPath |
| 51 | hours-from-duration | true | XPath |
| 52 | hours-from-time | true | XPath |
| 53 | id | true | XPath |
| 54 | idref | true | XPath |
| 55 | implicit-timezone | true | XPath |
| 56 | in-scope-prefixes | true | XPath |
| 57 | index-of | true | XPath |
| 58 | insert-before | true | XPath |
| 59 | iri-to-uri | true | XPath |
| 60 | key | true | XSLT |
| 61 | lang | true | XPath |
| 62 | last | true | XPath |
| 63 | local-name | true | XPath |
| 64 | local-name-from-QName | true | XPath |
| 65 | lower-case | true | XPath |
| 66 | matches | true | XPath |
| 67 | max | true | XPath |
| 68 | min | true | XPath |
| 69 | minutes-from-dateTime | true | XPath |
| 70 | minutes-from-duration | true | XPath |
| 71 | minutes-from-time | true | XPath |
| 72 | month-from-date | true | XPath |
| 73 | month-from-dateTime | true | XPath |
| 74 | months-from-duration | true | XPath |
| 75 | name | true | XPath |
| 76 | namespace-uri | true | XPath |
| 77 | namespace-uri-for-prefix | true | XPath |
| 78 | namespace-uri-from-QName | true | XPath |
| 79 | nilled | true | XPath |
| 80 | node-name | true | XPath |
| 81 | normalize-space | true | XPath |
| 82 | normalize-unicode | true | XPath |
| 83 | not | true | XPath |
| 84 | number | true | XPath |
| 85 | one-or-more | true | XPath |
| 86 | position | true | XPath |
| 87 | prefix-from-QName | true | XPath |
| 88 | QName | true | XPath |
| 89 | regex-group | true | XSLT |
| 90 | remove | true | XPath |
| 91 | replace | true | XPath |
| 92 | resolve-QName | true | XPath |
| 93 | resolve-uri | true | XPath |
| 94 | reverse | true | XPath |
| 95 | root | true | XPath |
| 96 | round | true | XPath |
| 97 | round-half-to-even | true | XPath |
| 98 | seconds-from-dateTime | true | XPath |
| 99 | seconds-from-duration | true | XPath |
| 100 | seconds-from-time | true | XPath |
| 101 | starts-with | true | XPath |
| 102 | static-base-uri | true | XPath |
| 103 | string | true | XPath |
| 104 | string-join | true | XPath |
| 105 | string-length | true | XPath |
| 106 | string-to-codepoints | true | XPath |
| 107 | subsequence | true | XPath |
| 108 | substring | true | XPath |
| 109 | substring-after | true | XPath |
| 110 | substring-before | true | XPath |
| 111 | sum | true | XPath |
| 112 | system-property | true | XSLT |
| 113 | timezone-from-date | true | XPath |
| 114 | timezone-from-dateTime | true | XPath |
| 115 | timezone-from-time | true | XPath |
| 116 | tokenize | true | XPath |
| 117 | trace | true | XPath |
| 118 | translate | true | XPath |
| 119 | true | true | XPath |
| 120 | type-available | true | XSLT |
| 121 | unordered | true | XPath |
| 122 | unparsed-entity-public-id | true | XSLT |
| 123 | unparsed-entity-uri | true | XSLT |
| 124 | unparsed-text | true | XSLT |
| 125 | unparsed-text-available | true | XSLT |
| 126 | upper-case | true | XPath |
| 127 | year-from-date | true | XPath |
| 128 | year-from-dateTime | true | XPath |
| 129 | years-from-duration | true | XPath |
| 130 | zero-or-one | true | XPath |
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.
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:analyze-string | true |
| 2 | xsl:apply-imports | true |
| 3 | xsl:apply-templates | true |
| 4 | xsl:attribute | true |
| 5 | xsl:attribute-set | false (not instruction) |
| 6 | xsl:call-template | true |
| 7 | xsl:character-map | false (not instruction) |
| 8 | xsl:choose | true |
| 9 | xsl:comment | true |
| 10 | xsl:copy | true |
| 11 | xsl:copy-of | true |
| 12 | xsl:decimal-format | false (not instruction) |
| 13 | xsl:document | true |
| 14 | xsl:element | true |
| 15 | xsl:fallback | true |
| 16 | xsl:for-each | true |
| 17 | xsl:for-each-group | true |
| 18 | xsl:function | false (not instruction) |
| 19 | xsl:if | true |
| 20 | xsl:import | false (not instruction) |
| 21 | xsl:import-schema | false (not instruction) |
| 22 | xsl:include | false (not instruction) |
| 23 | xsl:key | false (not instruction) |
| 24 | xsl:matching-substring | false (not instruction) |
| 25 | xsl:message | true |
| 26 | xsl:namespace | true |
| 27 | xsl:namespace-alias | false (not instruction) |
| 28 | xsl:next-match | true |
| 29 | xsl:non-matching-substring | false (not instruction) |
| 30 | xsl:number | true |
| 31 | xsl:otherwise | false (not instruction) |
| 32 | xsl:output | false (not instruction) |
| 33 | xsl:output-character | false (not instruction) |
| 34 | xsl:param | false (not instruction) |
| 35 | xsl:perform-sort | true |
| 36 | xsl:preserve-space | false (not instruction) |
| 37 | xsl:processing-instruction | true |
| 38 | xsl:result-document | true |
| 39 | xsl:sequence | true |
| 40 | xsl:sort | false (not instruction) |
| 41 | xsl:strip-space | false (not instruction) |
| 42 | xsl:stylesheet | false (not instruction) |
| 43 | xsl:template | false (not instruction) |
| 44 | xsl:text | true |
| 45 | xsl:transform | false (not instruction) |
| 46 | xsl:value-of | true |
| 47 | xsl:variable | true |
| 48 | xsl:when | false (not instruction) |
| 49 | xsl:with-param | false (not instruction) |
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:
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.
Peter Rushforth's Geofunctions, an open-source library of XSLT / functions, templates, stylesheets and classes devoted to the processing of geographic data in XML.
Dimitre Novatchev's FXSL, "the functional programming library for XSLT".
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.
Many of Saxon's extension functions are unique, adding functionality to XSLT.2.0
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 |
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.
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 |
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) |
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 |
Functions in EXSLT Common are irrelevant in XSLT/XPath 2.0 having similar functions.
| No | EXSL Function | Available |
|---|---|---|
| 1 | exsl:node-set | false |
| 2 | exsl:object-type | false |
Elements in EXSLT Common are irrelevant in XSLT 2.0 having similar elements.
| No | EXSL Element | Available |
|---|---|---|
| 1 | exsl:document | false |
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) |
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 | false |
| 10 | math:log | false |
| 11 | math:lowest | false |
| 12 | math:max | false |
| 13 | math:min | false |
| 14 | math:power | false |
| 15 | math:random | false |
| 16 | math:sin | false |
| 17 | math:sqrt | false |
| 18 | math:tan | false |
The random() function in EXSLT Random is still
relevant in XSLT 2.0.
| No | EXSL Function | Available |
|---|---|---|
| 1 | random:random-sequence | false |
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 |
Functions in EXSLT Sets are irrelevant in XSLT/XPath 2.0 having similar functionality.
| No | EXSL Function | Available |
|---|---|---|
| 1 | set:difference | false |
| 2 | set:distinct | false |
| 3 | set:has-same-node | false |
| 4 | set:intersection | false |
| 5 | set:leading | false |
| 6 | set:trailing | false |
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