Re: Cross-processor XSLT extension functions

What I should do is add XSLT 2.0 implementations of all the EXSLT functions to the unit testing framework too…

Better still would be to add them to exslt.org as an implementation of exslt for xslt2 systems. Not so useful long term, as xslt2 has most of the functionality natively but very useful short term either to make stylesheets that run on xslt1+exslt and xslt2 without needing conditional code around every function call, or (very much a concern here at present) as an aid to switching from xslt1 to 2.

We tend to use saxon rather than exslt extensions (for historical reasons mainly) but it’s proved very valuable to have functions like

<xsl:function name="saxon:tokenize">
  <xsl:param name="s"/>
  <xsl:sequence select="tokenize($s,'\s+')"/>
</xsl:function>

<xsl:function name="saxon:node-set">
  <xsl:param name="rtf"/>
  <xsl:sequence select="$rtf"/>
</xsl:function>

<xsl:function name="saxon:distinct">
  <xsl:param name="n"/>
  <xsl:sequence select="distinct-values($n)"/>
</xsl:function>

We’ll remove these (and permanently switch to xslt2) sometime soon, but during the changeover testing such functions allow comparison of results on the old and new processor without changing the stylesheet which is a good thing as there’s over 20K lines of stylesheet(s) in this case…

David

Reply

The content of this field is kept private and will not be shown publicly.