So is the following correct $xsl and $content have been defined before.
 
    <xsl:variable name="param"><filepath><xsl:value-of select="$path"/></filepath></xsl:variable>
    <xsl:copy-of select="saxon:transform($xsl,$contents,$param)"/>
 
Using this I find that I do not get a value passed through to the spread sheet.
 
Martin


From: saxon-help-bounces@lists.sourceforge.net [mailto:saxon-help-bounces@lists.sourceforge.net] On Behalf Of Michael Kay
Sent: 27 June 2008 11:33
To: 'Mailing list for the SAXON XSLT and XQuery processor'
Subject: Re: [saxon] Saxon:transform example with parameters

Assuming you're in XQuery it might look like this:
 
let $results :=
  <customers>{ //customer[location="Scotland"] }</customers>
let $rendition := saxon:compile-stylesheet(doc('show-customers.xsl'))
return saxon:transform($rendition, $results, (<location-param>Scotland</location-param>, <debug>true</debug>))
Note that you can only pass in atomic values for parameters (not nodes), and unless you go to the trouble of schema-validating the parameters document, the values will be untypedAtomic.
If you're in XSLT, you'll have to set the parameters up in a variable and then reference the variable in the function call.
 
Michael Kay
Saxonica

From: saxon-help-bounces@lists.sourceforge.net [mailto:saxon-help-bounces@lists.sourceforge.net] On Behalf Of martin.me.roberts@bt.com
Sent: 27 June 2008 11:21
To: saxon-help@lists.sourceforge.net
Subject: [saxon] Saxon:transform example with parameters

Hi,
  could you please give an example of how you would pass a parameter into a stylesheet using the saxon:transform extension function.
 
  Thanks
 
Martin