Page 1 of 1
Passing A Parameter As A Node
Posted: Wed Sep 02, 2009 9:50 pm
by jeromebridge
I have the following parameter defined in my XSLT:
Code: Select all
<xsl:param name="param1" as="node()" select="node()" />
How can I setup the parameters in my XSLT scenario to pass a valid XML document to this parameter. Everything I've tried passes a string.
Re: Passing A Parameter As A Node
Posted: Thu Sep 03, 2009 11:26 am
by sorin_ristache
Hello,
We plan to allow setting XSLT parameters of type document in a future version. In the current version all parameters set in
the Configure Parameters dialog are of type String. Until we implement that you can use an additional stylesheet that loads the XML document and passes it to your stylesheet and set the additional stylesheet in the transformation scenario. The additional stylesheet can be:
Code: Select all
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="your-stylesheet.xsl"/>
<xsl:param name="your-param" select="document('path-of-XML-file.xml')"/>
</xsl:stylesheet>
Regards,
Sorin
Re: Passing A Parameter As A Node
Posted: Mon Apr 04, 2011 2:39 pm
by sorin_ristache
Hello,
Starting with Oxygen 12.2 which will be released in April 2011 each parameter from the XSLT and XQuery transformation scenarios will have an XPath checkbox that will allow setting the type of the parameter to XPath. That means you will select the XPath checkbox for your parameter and will set document('path-of-XML-file.xml') as value. The expression document('path-of-XML-file.xml') will be evaluated as XPath expression and the result will be passed to your XSLT transformation.
Regards,
Sorin