Test Cases for XSLT support in browsers

Please send feedback to julian.reschke@gmx.de.

Related Reading

Browsers Tested

Unless stated otherwise, all tests were executed with the latest release versions of Firefox, Google Chrome, Microsoft Internet Explorer (both 8 & 9 as IE9 is not available for XP), Safari and Opera on a machine running Windows 7.

Test Result Summary

Colors -- Red: Failure, Green: Pass, Yellow: Warning, Grey: Not Supported

Score -- Passes: 2 points, Warning: 1 point, in percent of possible points (this should be updated to count optional features differently)

Test CaseFirefox 40Microsoft IE 11Safari 7Google Chrome 45
Summary77% passes, 23% failures, 0% warnings, 0% unsupported, 0% to-do
Score: 77
62% passes, 15% failures, 0% warnings, 23% unsupported, 0% to-do
Score: 62
62% passes, 23% failures, 0% warnings, 15% unsupported, 0% to-do
Score: 62
62% passes, 23% failures, 0% warnings, 15% unsupported, 0% to-do
Score: 62
Processing Instructionpi-tx-txpasspasspasspass
pi-tx-axpasspasspasspass
pi-ax-axpasspassfailfail ((see Chrome Issue 81897))
pi-no-txfail ((see Mozilla Bug 688712)) failfailfail
pi-tc-txfail ((see Mozilla Bug 688712)) failfailfail
Source Loadingsrc-wspasspasspasspass
XSLT 1.0 supportxslt-namespace-axisfail (no support for namespace axis (see Mozilla Bug 94270)) passpasspass
Feature Detectionft-system-propertypasspasspasspass
ft-system-property-unknownpasspasspass (fixed in 7.0) pass (fixed in 45)
Forwards Compatibility Modeft-xsl-functionpass (xsl:function ignored) pass (xsl:function ignored) pass (fixed in 7.0) pass (fixed in 45)
EXSLT Supportft-exslt-nodesetpassunsupported (but see David Carlisle: "The EXSLT node-set function" and MS Connect feedback 612252) passpass
ft-exslt-object-typepassunsupportedunsupportedunsupported
ft-exslt-date-timepassunsupported (but can be simulated using msxsl:script) unsupported ((see Webkit bug 4079)) unsupported ((see Chromium bug 1006210))

Test Cases

Processing Instruction

Basic tests for the stylesheet processing instruction

pi-tx-tx [TEST]

Test Results
FF40pass
MSIE11pass
Safaripass
Chromepass

testing <?xml-stylesheet type='text/xsl' href='...' ?>, referencing an XSLT served with media type "text/xsl"

Result for this UA:

pi-tx-ax [TEST]

Test Results
FF40pass
MSIE11pass
Safaripass
Chromepass

testing <?xml-stylesheet type='text/xsl' href='...' ?>, referencing an XSLT served with media type "application/xslt+xml"

Result for this UA:

pi-ax-ax [TEST]

Test Results
FF40pass
MSIE11pass
Safarifail
Chromefail ((see Chrome Issue 81897))

testing <?xml-stylesheet type='application/xslt+xml' href='...' ?>, referencing an XSLT served with media type "application/xslt+xml"

Result for this UA:

pi-no-tx [TEST]

Test Results
FF40fail ((see Mozilla Bug 688712))
MSIE11fail
Safarifail
Chromefail

testing <?xml-stylesheet href='...' ?>, referencing an XSLT served with media type "text/xsl", but not specifying the media type

The media type is specified to be advisory only, so the XSLT should be fetched and used (see Section 4 of xml-stylesheet).

Result for this UA:

pi-tc-tx [TEST]

Test Results
FF40fail ((see Mozilla Bug 688712))
MSIE11fail
Safarifail
Chromefail

testing <?xml-stylesheet type="text/css" href='...' ?>, referencing an XSLT served with media type "text/xsl", but specifying the incorrect media type "text/css"

The media type is specified to be advisory only, so the XSLT should be fetched and used (see Section 4 of xml-stylesheet).

Result for this UA:

Source Loading

Tests about how the XML source is loaded.

src-ws [TEST]

Test Results
FF40pass
MSIE11pass
Safaripass
Chromepass

whitespace nodes in XML source

Result for this UA:

XSLT 1.0 support

Tests for XSLT 1.0 features.

xslt-namespace-axis [TEST]

Test Results
FF40fail (no support for namespace axis (see Mozilla Bug 94270))
MSIE11pass
Safaripass
Chromepass

namespace axis

Result for this UA:

Feature Detection

Basic tests for feature detection

ft-system-property [TEST]

Test Results
FF40pass
MSIE11pass
Safaripass
Chromepass

testing system properties

Result for this UA:

ft-system-property-unknown [TEST]

Test Results
FF40pass
MSIE11pass
Safaripass (fixed in 7.0)
Chromepass (fixed in 45)

testing unknown system properties

Result for this UA:

Forwards Compatibility Mode

Tests forwards compatibility mode.

ft-xsl-function [TEST]

Test Results
FF40pass (xsl:function ignored)
MSIE11pass (xsl:function ignored)
Safaripass (fixed in 7.0)
Chromepass (fixed in 45)

testing forwards compat mode with xsl:function

Result for this UA:

EXSLT Support

Some tests for EXSLT Support.

ft-exslt-nodeset [TEST]

Test Results
FF40pass
MSIE11unsupported (but see David Carlisle: "The EXSLT node-set function" and MS Connect feedback 612252)
Safaripass
Chromepass

testing exslt:node-set

Result for this UA:

ft-exslt-object-type [TEST]

Test Results
FF40pass
MSIE11unsupported
Safariunsupported
Chromeunsupported

testing exslt:object-type

Result for this UA:

ft-exslt-date-time [TEST]

Test Results
FF40pass
MSIE11unsupported (but can be simulated using msxsl:script)
Safariunsupported ((see Webkit bug 4079))
Chromeunsupported ((see Chromium bug 1006210))

testing exslt-date:date-time

Result for this UA:

Test Case Generation

Both this document and the indiviual test "scripts" are generated from one single XML source (xslt.xml), using an XSLT2 transformation (xslt.xslt).

To generate the files, an XSLT2 processor such as Saxon 9 is needed. Copy both files into an empty directory, then run:

saxon9 xslt.xml xslt.xslt > index.html

Note that this will also generate a set of "asis" files that contain the actual test cases. These can be served using the Apache httpd mod_asis module.