Reconnaissance

Last modified by Nicolas Gregoire on 2012/02/03 14:52

Using XSLT properties

XSLT standards define several properties about the XSLT engine itself. Querying for these properties allows to easily identify the engine.

XSLT 1.0

The function system-property() supports by default the following properties :

  • xsl:version : a number giving the version of XSLT implemented by the processor
  • xsl:vendor : a string identifying the vendor of the XSLT processor
  • xsl:vendor-url : a URL identifying the vendor of the XSLT processor (typically its Web site)

The attached stylesheet recon-xslt10.xsl fingerprints a XSLT 1.0 engine.

XSLT 2.0

This version supports some additional properties :

  • xsl:product-name : a string containing the name of the implementation, as defined by the implementer
  • xsl:product-version : a string identifying the version of the implementation, as defined by the implementer
  • xsl:is-schema-aware : returns "yes" if the XSLT processor is schema-aware, or "no" otherwise
  • xsl:supports-serialization : returns "yes" if the XSLT processor offers this feature, or "no" otherwise
  • xsl:supports-backwards-compatibility : returns "yes" if the XSLT processor offers this feature, or "no" otherwise

  The attached stylesheet recon-xslt20.xsl fingerprints a XSLT 2.0 engine.

Enumerating supported features

Needed functions

The XSLT standards define two additional functions used to enumerate the available features :

  • function-available()
  • element-available()

Example

This stylesheet (by "xmlplease.com") uses these functions to test the availability of :

  • XSLT and XPath functions
  • XSLT elements
  • Saxon extensions
  • EXSLT extensions
IconWarning

TODO : include my own examples !

Live demo

If you want to identify the XSLT engine used in your browser and its features, please click on recon-enumerate-features.xml.

IconWarning

This will crash Opera (NULL ptr dereference aka bug DSK-355332) !