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 18Microsoft IE 8Microsoft IE 9Opera 12Safari 7Google Chrome 23
Summary77% passes, 23% failures, 0% warnings, 0% unsupported, 0% to-do
Score: 77
46% passes, 31% failures, 0% warnings, 23% unsupported, 0% to-do
Score: 46
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
46% passes, 38% failures, 0% warnings, 15% unsupported, 0% to-do
Score: 46
Processing Instructionpi-tx-txpasspasspasspasspass
pi-tx-axpasspasspasspasspass
pi-ax-axpassfailpassfailfailfail ((see Chrome Issue 81897))
pi-no-txfail ((see Mozilla Bug 688712)) failfailfailfail
pi-tc-txfail ((see Mozilla Bug 688712)) failfailfailfail
Source Loadingsrc-wspassfail (drops "ignorable" whitespace (see MS Connect feedback 489112)) passpasspasspass
XSLT 1.0 supportxslt-namespace-axisfail (no support for namespace axis (see Mozilla Bug 94270)) passpasspasspass
Feature Detectionft-system-propertypasspasspasspasspass
ft-system-property-unknownpasspasspasspass (fixed in 7.0) fail (getting an unknown system property aborts the transformation (see Chrome Issue 142292, Webkit bug 47453 and Gnome (Libxslt) bug 631803))
Forwards Compatibility Modeft-xsl-functionpass (xsl:function ignored) pass (xsl:function ignored) pass (xsl:function ignored) pass (fixed in 7.0) fail (transformation aborts (see Chrome Issue 157869, Webkit bug 89279 and Gnome (Libxslt) bug 677901))
EXSLT Supportft-exslt-nodesetpassunsupported (but see David Carlisle: "The EXSLT node-set function" and MS Connect feedback 612252) passpasspass
ft-exslt-object-typepassunsupportedunsupportedunsupportedunsupported
ft-exslt-date-timepassunsupported (but can be simulated using msxsl:script) unsupportedunsupported ((see Webkit bug 4079)) unsupported ((see Webkit bug 4079))

Test Cases

Processing Instruction

Basic tests for the stylesheet processing instruction

pi-tx-tx [TEST]

Test Results
FF18pass
MSIE8pass
MSIE9pass
Operapass
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
FF18pass
MSIE8pass
MSIE9pass
Operapass
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
FF18pass
MSIE8fail
MSIE9pass
Operafail
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
FF18fail ((see Mozilla Bug 688712))
MSIE8fail
MSIE9fail
Operafail
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
FF18fail ((see Mozilla Bug 688712))
MSIE8fail
MSIE9fail
Operafail
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
FF18pass
MSIE8fail (drops "ignorable" whitespace (see MS Connect feedback 489112))
MSIE9pass
Operapass
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
FF18fail (no support for namespace axis (see Mozilla Bug 94270))
MSIE8pass
MSIE9pass
Operapass
Safaripass
Chromepass

namespace axis

Result for this UA:

Feature Detection

Basic tests for feature detection

ft-system-property [TEST]

Test Results
FF18pass
MSIE8pass
MSIE9pass
Operapass
Safaripass
Chromepass

testing system properties

Result for this UA:

ft-system-property-unknown [TEST]

Test Results
FF18pass
MSIE8pass
MSIE9pass
Operapass
Safaripass (fixed in 7.0)
Chromefail (getting an unknown system property aborts the transformation (see Chrome Issue 142292, Webkit bug 47453 and Gnome (Libxslt) bug 631803))

testing unknown system properties

Result for this UA:

Forwards Compatibility Mode

Tests forwards compatibility mode.

ft-xsl-function [TEST]

Test Results
FF18pass (xsl:function ignored)
MSIE8pass (xsl:function ignored)
MSIE9pass (xsl:function ignored)
Operapass (xsl:function ignored)
Safaripass (fixed in 7.0)
Chromefail (transformation aborts (see Chrome Issue 157869, Webkit bug 89279 and Gnome (Libxslt) bug 677901))

testing forwards compat mode with xsl:function

Result for this UA:

EXSLT Support

Some tests for EXSLT Support.

ft-exslt-nodeset [TEST]

Test Results
FF18pass
MSIE8unsupported (but see David Carlisle: "The EXSLT node-set function" and MS Connect feedback 612252)
MSIE9unsupported (but see David Carlisle: "The EXSLT node-set function" and MS Connect feedback 612252)
Operapass
Safaripass
Chromepass

testing exslt:node-set

Result for this UA:

ft-exslt-object-type [TEST]

Test Results
FF18pass
MSIE8unsupported
MSIE9unsupported
Operaunsupported
Safariunsupported
Chromeunsupported

testing exslt:object-type

Result for this UA:

ft-exslt-date-time [TEST]

Test Results
FF18pass
MSIE8unsupported (but can be simulated using msxsl:script)
MSIE9unsupported (but can be simulated using msxsl:script)
Operaunsupported
Safariunsupported ((see Webkit bug 4079))
Chromeunsupported ((see Webkit bug 4079))

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.