Naxos: an XSLT 1.0 processor written in XSLT 1.0

1 Introduction

Naxos is an XSLT 1.0 processor implemented in pure XSLT 1.0.

I presented Naxos at the Open Source Developers' Conference 2006. The conference paper is available online.

2 Obtaining Naxos

Naxos can be downloaded from http://futzle.com/~debbiep/naxos/naxos.zip.

3 Running Naxos

Naxos was developed and tested using Saxon-B 6.5. Invoke Naxos on a document with a statement like
java com.icl.saxon.StyleSheet xml-document naxos.xsl
Naxos obtains the stylesheet from the document's xml-stylesheet declaration.

Naxos is very slow and memory-hungry. Stylesheets larger than toy-sized will probably fail to run even if you specify a large heap for the JVM with -Xmx.

4 Implementation status

XPath

Naxos contains an implementation of XPath 1.0, including the core functions defined for XPath 1.0 and many extension functions defined in XSLT 1.0.

Table 1. XPath functions available in Naxos
Function name Implemented
last() Yes
posiiton() Yes
count() Yes
id() Yes1
local-name() Yes
namespace-uri() Yes
name() Yes
string() Yes
concat() Yes
starts-with() Yes
contains() Yes
substring-before() Yes
substring-after() Yes
string-length() Yes
normalize-space() Yes
translate() Yes
boolean() Yes
true() Yes
false() Yes
lang() Yes
number() Yes
sum() Yes
floor() Yes
ceiling() Yes
round() Yes
Table 2. XSLT functions available in Naxos
Function name Implemented
document() Yes
key() No
format-number() No
current() Yes
unparsed-entity-uri() No
generate-id() Yes
system-property() Yes
function-available() No
element-available() No

XSLT

Naxos implements a subset of XSLT 1.0. <xsl:import> is also supported.

Table 3. XSLT top-level elements available in Naxos
Element Implemented
xsl:attribute-set No
xsl:decimal-format No
xsl:include Yes
xsl:key No
xsl:namespace-alias No
xsl:output Partial (@method="text" or @method="xml")
xsl:param Partial23
xsl:preserve-space No
xsl:template Yes
xsl:variable Partial4

Naxos can process most template instructions. <xsl:sort> is available for both <xsl:apply-templates> and <xsl:for-each>. <xsl:with-param> is available for both <xsl:apply-templates> and <call-template>. <xsl:when> and <xsl:otherwise> are both available for <xsl:choose>.

Table 4. XSLT instruction elements available in Naxos
Element Implemented
xsl:apply-imports No
xsl:apply-templates Yes
xsl:attribute Yes
xsl:call-template Yes
xsl:choose Yes
xsl:comment Yes
xsl:copy No
xsl:copy-of No
xsl:element Yes
xsl:fallback No
xsl:for-each Yes
xsl:if Yes
xsl:message Yes
xsl:number No
xsl:param Yes
xsl:processing-instruction Yes
xsl:text Yes (@disable-output-escaping not supported)
xsl:value-of Yes
xsl:variable Yes
1 But not useful without DTD support
2 Using only @select, not element contents
3 But not useful because XSLT does not define how parameters are passed to a stylesheet
4 Using only @select, not element contents