Changes for page Reconnaissance
on 2012/01/10 14:47
on 2012/01/16 12:53
Summary
-
Page properties (2 modified, 0 added, 0 removed)
-
Attachments (0 modified, 3 added, 0 removed)
Details
- Page properties
-
- Tags
-
... ... @@ -1,0 +1,1 @@ 1 +recon|fingerprint|system-property - Content
-
... ... @@ -1,6 +1,10 @@ 1 +{{toc/}} 2 + 3 += Using XSLT properties = 4 + 1 1 XSLT standards define several properties about the XSLT engine itself. Querying for these properties allows to easily identify the engine. 2 2 3 -== =XSLT 1.0 ===7 +== XSLT 1.0 == 4 4 5 5 The function [[system-property()>>http://www.w3.org/TR/xslt#function-system-property||rel="__blank"]] supports by default the following properties : 6 6 ... ... @@ -8,17 +8,45 @@ 8 8 * xsl:vendor : a string identifying the vendor of the XSLT processor 9 9 * xsl:vendor-url : a URL identifying the vendor of the XSLT processor (typically its Web site) 10 10 15 +The attached stylesheet [[recon-xslt10.xsl>>attach:recon-xslt10.xsl]] fingerprints a XSLT 1.0 engine. 16 + 11 11 == XSLT 2.0 == 12 12 13 - 14 14 This version supports some [[additional>>http://www.w3.org/TR/xslt20/#system-property||rel="__blank"]] properties : 15 15 16 16 * xsl:product-name : a string containing the name of the implementation, as defined by the implementer 17 17 * xsl:product-version : a string identifying the version of the implementation, as defined by the implementer 18 -* xsl:is-schema-aware : returns the string"yes" inthe casefaschema-awareXSLT processor, or "no" otherwise19 -* xsl:supports-serialization : returns the string"yes" inthecaseof aprocessorthatoffers the serializationfeature, or "no" otherwise20 -* xsl:supports-backwards-compatibility : returns the string"yes" inthecaseof aprocessorthatoffers the backwardscompatibilityfeature, or "no" otherwise23 +* xsl:is-schema-aware : returns "yes" if the XSLT processor is schema-aware, or "no" otherwise 24 +* xsl:supports-serialization : returns "yes" if the XSLT processor offers this feature, or "no" otherwise 25 +* xsl:supports-backwards-compatibility : returns "yes" if the XSLT processor offers this feature, or "no" otherwise 21 21 22 - 27 + The attached stylesheet [[recon-xslt20.xsl>>attach:recon-xslt20.xsl]] fingerprints a XSLT 2.0 engine. 23 23 29 += Enumerating supported features = 24 24 31 +== Needed functions == 32 + 33 +The XSLT standards define two additional functions used to enumerate the available features : 34 + 35 +* function-available() 36 +* element-available() 37 + 38 +== Example == 39 + 40 +This [[stylesheet>>http://www.xmlplease.com/element-function-available.xsl||rel="__blank"]] uses these functions to test the availability of : 41 + 42 +* XSLT and XPath functions 43 + 44 +* XSLT elements 45 + 46 +* Saxon extensions 47 + 48 +* EXSLT extensions 49 + 50 +{{warning}} 51 +TODO : include my own examples ! 52 +{{/warning}} 53 + 54 +== Live demo == 55 + 56 +If you want to execute the "xmlplease.com" stylesheet, just click on [[attach:recon-enumerate-features.xml]] (will crash Opera).
- recon-enumerate-features.xml
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +xwiki:XWiki.NicolasGregoire - Size
-
... ... @@ -1,0 +1,1 @@ 1 +108 bytes - Content
-
... ... @@ -1,0 +1,3 @@ 1 +<?xml-stylesheet type="text/xsl" href="http://www.xmlplease.com/element-function-available.xsl" ?> 2 +<empty/> 3 +
- recon-xslt10.xsl
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +xwiki:XWiki.NicolasGregoire - Size
-
... ... @@ -1,0 +1,1 @@ 1 +372 bytes - Content
-
... ... @@ -1,0 +1,9 @@ 1 +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 2 +<xsl:output method="text"/> 3 +<xsl:template match="/"> 4 +Version : <xsl:value-of select="system-property('xsl:version')" /> 5 +Vendor : <xsl:value-of select="system-property('xsl:vendor')" /> 6 +Vendor URL : <xsl:value-of select="system-property('xsl:vendor-url')" /> 7 +</xsl:template> 8 +</xsl:stylesheet> 9 +
- recon-xslt20.xsl
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +xwiki:XWiki.NicolasGregoire - Size
-
... ... @@ -1,0 +1,1 @@ 1 +816 bytes - Content
-
... ... @@ -1,0 +1,14 @@ 1 +<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 2 +<xsl:output method="text"/> 3 +<xsl:template match="/"> 4 +Version : <xsl:value-of select="system-property('xsl:version')" /> 5 +Vendor : <xsl:value-of select="system-property('xsl:vendor')" /> 6 +Vendor URL : <xsl:value-of select="system-property('xsl:vendor-url')" /> 7 +Product Name : <xsl:value-of select="system-property('xsl:product-name')" /> 8 +Product Version : <xsl:value-of select="system-property('xsl:product-version')" /> 9 +Is Schema Aware : <xsl:value-of select="system-property('xsl:is-schema-aware')" /> 10 +Supports Serialization : <xsl:value-of select="system-property('xsl:supports-serialization')" /> 11 +Backward Compatible : <xsl:value-of select="system-property('xsl:supports-backwards-compatibility')" /> 12 +</xsl:template> 13 +</xsl:stylesheet> 14 +