[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] Exsl functions in xslt 2


Subject: [xsl] Exsl functions in xslt 2
From: "Andrew Welch" <AWelch@xxxxxxxxxxxxxxx>
Date: Mon, 19 Jan 2004 14:05:58 -0000

Hi all,

Recently DC came up with a very neat solution to get around using
function-available all over the place in a stylesheet that needed to be
portable between Saxon and MSXML

For those that missed it, it was this:

<xsl:stylesheet version="1.0"   
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:exslt="http://exslt.org/common"
  xmlns:exsltf="http://exslt.org/functions"
  xmlns:msxsl="urn:schemas-microsoft-com:xslt"
  extension-element-prefixes="exslt exsltf  msxsl"> 

<xsl:variable name="x"> 
  <foo> 
   <bar>hello world</bar> 
  </foo> 
</xsl:variable> 

<exsltf:function name="msxsl:node-set"> 
  <xsl:param name="x"/> 
  <exsltf:result select="exslt:node-set($x)"/> 
</exsltf:function> 

<xsl:template match="/"> 
  <xsl:value-of select="msxsl:node-set($x)//bar)"/>
</xsl:template> 

</xsl:stylesheet>

(MSXML will use msxsl:node-set directly, Saxon will use the
exsltf:node-set)

This is great and works well for Saxon 6.5.3 and MSXML 4.  However, I
would also like it to work with Saxon 7.8 - could someone with xslt 2.0
experience let me know if its possible to have this kind of solution
work for Saxon 7.8 and MSXML4 (Saxon 7.8 currently complains... as I
believe functions are built into 2.0)?

The history is that the app Im writing for uses Saxon 7.8, and there is
a requirement to view transforms outside of the app using MSXML4.  If
possible, it would be best to add this functionality in the stylesheets,
rather than alter the code for the app.  

Thanks for any suggestions,

cheers
andrew




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords