Adding Parameters to an XSLT Transformation
Posted: Thu Mar 07, 2013 5:46 pm
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:
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="' '"/>
</xsl:for-each>
</catalog>
</xsl:result-document>
</xsl:template>
</xsl:stylesheet>