exslt.org extensions

I am trying to use an exslt extension in one of my transformations. I got an example off this site about how to concatenate xml files into one.

I have implemented the namespace and the element prefix correctly, but every time I try and run it from my command line I recieve the following error...

Cannot find a matching 1-argument function named {http://exslt.org/common}node-set() in variable step-concat (filename and line number are in here blah blah blah)

I have no idea what is going wrong as I am quite new to this stuff. My xsl file is

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
xmlns:exsl="http://exslt.org/common"
extension-element-prefixes="exsl">

<!-- STEP Files -->
<xsl:variable name="step-output">
    <xsl:for-each select="/index/file">
        <xsl:copy-of select="document(.)" />
    </xsl:for-each>
</xsl:variable>

<!-- STEP Files as one -->
<xsl:variable name="step-concat" select="exsl:node-set($step-output)" />

<!-- Root Template -->
<xsl:template match="/">
    <xsl:element name="foo">
        <xsl:apply-templates select="$step-concat/foo"/>
    </xsl:element>
</xsl:template>

<xsl:template match="foo">
    <xsl:element name="text">
        <xsl:value-of select="bar"/>
    </xsl:element>
</xsl:template>

What am I doing wrong? I have tried downloading the module from exslt.org, but it doesn't make any sense to me at all...

Answers


Saxon HE does not provide any built-in extension function, unlike Saxon PE.

However, you can write and register your own extension functions at the Processor, so you could easily implement exsl:node-set: http://www.saxonica.com/documentation/extensibility/integratedfunctions/

Another alternative is to use Saxon B 9.1


That's an XSLT 1.0 stylesheet. XSLT 2.0 makes many of the EXSLT extension functions unnecessary, such as "exsl:node-set()". You could convert this to an XSLT 2.0 stylesheet that does the same thing by changing the "version" in the first line to 2.0, and replace "exsl:node-set($step-output)" with just "$step-output". Of course XSLT 2.0 would require Saxon.


The exslt.org stuff only works when you register/add the extensions to your XSLT engine. Since you don't mention anything about your platform, it's kind of hard to help you out.


Need Your Help

Error trying to `#require "ctypes.foreign";;` in utop on Windows (Cygwin)

cygwin ocaml opam libffi utop

I managed to install and run OCaml + OPAM + utop on Windows (in Cygwin) thanks to the awesome guide by Jonathan Protzenko. In utop, I especially want to be able to use ctypes + ctypes.foreign to qu...

NuGet VS 2012 ServicePointManager does not support proxies with the https scheme

c# nuget visual-studio-2012

I have recently upgraded from VS2012 RC to RTM, and since the upgrade to RTM, I can no longer access nuget. I receive the following error in the Manage NuGet Packages window.