Adding Parameters to an XSLT Transformation

Here should go questions about transforming XML with XSLT and FOP.
bds
Posts: 47
Joined: Mon Jun 26, 2006 10:40 pm

Adding Parameters to an XSLT Transformation

Post by bds »

Hi all,

I have an input-less XSLT stylesheet [1] that generates a catalog file. I've figured out how to apply it from the CLI, but I'm stumped when it comes to adding the correct Parameters in the Scenario dialog(s).

I go into Configure Transformation Scenario(s) > New > XSLT Transformation > Parameters and I'm not quite sure what to enter in the Configure parameters. Is it just the template name (e.g. "main")? Or do I need to key the entire template into the Add Parameter dialog?

Thanks!
bds

[1] XSLT:

Code: Select all

?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs"
version="2.0">

<xsl:output method="xml"/>
<!-- collection() to grab documents -->
<xsl:variable name="docs" select="collection('file:///usr/home/bds/Documents/tdh-test/all-tdh/?select=*.xml;recurse=yes;on-error=warn')"/>

<xsl:template name="main">
<xsl:result-document href="tdh-catalog.xml" indent="yes">
<catalog>
<xsl:for-each select="$docs">
<doc href="{substring-after(document-uri(.), 'tdh-test/')}"/><xsl:value-of select="'&#10;'"/>
</xsl:for-each>
</catalog>
</xsl:result-document>
</xsl:template>
</xsl:stylesheet>
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: Adding Parameters to an XSLT Transformation

Post by adrian »

Hi,

The Parameters dialog is meant for specifying values for the stylesheet parameters (xsl:param) if any.
To specify the main template and mode press the Advanced options button (cogwheel icon next to the Transformer combo) and fill the corresponding fields.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
bds
Posts: 47
Joined: Mon Jun 26, 2006 10:40 pm

Re: Adding Parameters to an XSLT Transformation

Post by bds »

Hi Adrian,
thanks so much for the response. That's great! I see the options there. I appreciate the guidance!

Best,
BDS

Also: TIL the difference between a combo box and a dropdown/drop-down menu.
Post Reply