Template Parameters?

Here should go questions about transforming XML with XSLT and FOP.
eXentric
Posts: 3

Template Parameters?

Wed Mar 02, 2005 12:36 am

We have an XSLT template like this:

...
<xsl:template match="/">
<xsl:param name="FromDate"/>
<xsl:param name="ToDate"/>
...

I have specified the parameter 'FromDate' in both the Configure parameters dialog and in the Transformation scenario editor. It seems like no matter what I do, when I start debugging 'FromDate' seems undefined. Then, when the debugger steps over the template deffinition, 'FromDate' becomes defined but it's blank. The parameters I've setup are not passed to the template and I can't double-click the variable and change it while debugging either.

Am I missing something? Is this not what the parameters dialog is for?

Jared
sorin_ristache
Posts: 4144

Wed Mar 02, 2005 11:25 am

Hello,

In the Configure parameters dialog you set the values of global not local stylesheet parameters. Global parameters are declared outside of any XSLT template. Values of local parameters are set when you call that template explicitly in your stylesheet with some values for the parameters.

Regards,
Sorin
eXentric
Posts: 3

Wed Mar 02, 2005 7:28 pm

Thank you for your reply Sorin. Let me clearify:

We do not call the template directly. As you see, the template matches "/", which is the entire document. The way we get our data transformed is using the .Net framework. Specifically, the XslTransform.Transform method.

This method passes the parameters as an XsltArgumentList, and therefore we're passing the parameters in code and completely outside of the stylesheet.

Is there any way to reproduce this functionality in Oxygen? Or can you suggest another way of debugging?
george
Site Admin
Posts: 2100

Wed Mar 02, 2005 8:07 pm

Hi Jared,

What you need is to have global parameters. So instead of

...
<xsl:template match="/">
<xsl:param name="FromDate"/>
<xsl:param name="ToDate"/>
...

you need

...
<xsl:param name="FromDate"/>
<xsl:param name="ToDate"/>
...
<xsl:template match="/">
...

and then the parameters defined in oXygen in the Configure parameters dialog will be seen by your stylesheet.

Best Regards,
George
eXentric
Posts: 3

Thu Mar 03, 2005 11:09 pm

Thank you george for your reply, that does work for us. I realize that was probably a fundimental lack of understanding on our part of how it's supposed to work outside of the .Net environment.

Return to “XSLT and FOP”

Who is online

Users browsing this forum: No registered users and 2 guests