Template Parameters?
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 3
- Joined: Wed Mar 02, 2005 12:27 am
Template Parameters?
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
...
<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
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Post 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
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
-
- Posts: 3
- Joined: Wed Mar 02, 2005 12:27 am
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?
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?
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 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
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
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service