Saxon-HE processor with stylesheet caching.

The open-source implementation of XSLT 3.0, XPath 2.0 and 3.1, and XQuery 3.1. This provides the “basic” conformance level of these languages; it also supports some optional features of the specifications such as serialization and support for XQuery modules.


Binding name: xslt

Method: String process( String id, String xslt, String xml )

Process the given xml with the supplied xslt, storing the compiled xslt in the cache with the supplied id. Results of the transformation are returned as a String.


Subsequent calls to process() will search for and use the cached instance of the compiled XSLT giving much greater performance. The cache will expire entries after 10 minutes of inactivity.


def results = xslt.process("myTransform", resource.get('STYLESHEET'), resource.get('XmlIn'))
println results


<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:template match="/hello-world">
          <xsl:value-of select="greeting"/>
        <xsl:apply-templates select="greeter"/>
  <xsl:template match="greeter">
    <DIV>from <I><xsl:value-of select="."/></I></DIV>

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="hello.xsl"?>
<hello-world><greeter>An XSLT Programmer</greeter><greeting>Hello, World!</greeting></hello-world>