Page 1 of 1

Template Parameters?

Posted: Wed Mar 02, 2005 12:36 am
by eXentric
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

Posted: Wed Mar 02, 2005 11:25 am
by sorin_ristache
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

Posted: Wed Mar 02, 2005 7:28 pm
by eXentric
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?

Posted: Wed Mar 02, 2005 8:07 pm
by george
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

Posted: Thu Mar 03, 2005 11:09 pm
by eXentric
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.