Passing A Parameter As A Node

Here should go questions about transforming XML with XSLT and FOP.
jeromebridge
Posts: 1
Joined: Wed Sep 02, 2009 9:45 pm

Passing A Parameter As A Node

Post 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.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Passing A Parameter As A Node

Post 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
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Passing A Parameter As A Node

Post 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
Post Reply