1 Sablotron XSLT Extensions Readme File
2 =====================================
5 ----------------------------------------
7 Extension elements and functions as defined by XSLT 1.0 are
8 implemented in Sablotron since the version 0.80. Sablotron recognizes
9 the extension element <http://www.exslt.org/functions/script> as
10 suggested by exslt.org. There are some exceptions described later in
11 this document. Please note, that this feature is still supposed to be
14 If you want to benefit form this feature, you have to install
15 JavaScript engine from mozilla.org (SpiderMonkey). You have to do it
16 even when you have Mozilla browser installed, because the binary
17 browser installation doesn't include essential header files.
19 An alternative way to get all neccessary JS files is to download and
20 install Charlie application framework (see gingerall.org).
22 All you need to do on Sablotron side is to run the configure script
23 with --enable-javascript option. To use JS engine from Charlie
24 installation, type: ./configure --enable-javascript --enable-perlconnect
26 If you have installed JS libraries into non-standard directories, you
27 need to set (and export) CPLUS_INCLUDE_PATH/LIBRARY_PATH to point to
28 directories where the header files/lib files (e.g. libjs.so) can be found.
30 The default name for the linked library is 'js' (-ljs switch) - if you
31 need to override this value, you may set SABLOT_JSLIB environment
32 variable - the configure script uses -l$(SABLOT_JSLIB) in this case.
36 ----------------------------------------
38 Sablotron supports JavaScript (ECMA) scripting as described in XSTL WD
39 1.1. with few exceptions:
41 - DOM functions handling namespaces (with NS in their name) are not
42 supported (throw NOT_SUPPORTED exception)
44 - DOM model is read only (as supported, may be changed later)
46 - XSLTContext.stringValue is not supported
48 - Document.getElementsByTagName{NS} are not supported
50 - Element.getElementsByTagName{NS} are not supported
52 - DTD definition nodes are not supported
55 The following summarizes what IS supported:
57 - exslt:script element support
61 - DOM2 acces to a processed document
63 - type mapping between XPath and JavaScript including the XSLT
64 external object support
66 - function-available() function
68 - element-available() function
72 ----------------------------------------
75 <xsl:stylesheet version='1.0'
76 xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
77 xmlns:exslt='http://www.exslt.org/functions'
78 xmlns:my='http://gingerall.org/sablot/myfunc'
79 extension-element-prefixes='exslt'
80 exclude-result-prefixes='my'>
82 <xsl:output method='xml' indent='yes'/>
84 <exslt:script language='javascript' implements-prefix='my'>
87 function getNodeNames(nodeList)
90 for (i = 0; i < nodeList.length; i++)
92 ret += nodeList[i].nodeName + " ";
101 <xsl:template match='/'>
103 <xsl:value-of select='my:getNodeNames(*)'/>