I’m trying to dynamically generate a stylesheet that will output template which will make use of parameters, but the parser is trying to interpolate the variables meant for the 2nd step in the 1st step.
I’m going from XSLT to XSLT (aliased axsl) and then to XSL-FO
<xsl:template match="/">
<axsl:stylesheet version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<axsl:template match="/">
<axsl:param name="region-before-height" select="'1.75in'"/>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="single-transcript" axsl:use-attribute-sets="page-portrait">
<fo:region-body />
<fo:region-before extent="{$region-before-height}"/>
</fo:simple-page-master>
</fo:layout-master-set>
<axsl:apply-templates/>
</fo:root>
</axsl:template>
</axsl:stylesheet>
</xsl:template>
I get a runtime error saying “Variable ‘region-before-height’ has not been declared”.
What’s the correct syntax so that {$region-before-height} only gets interpreted during the 2nd transformation?
I think you need double curly brackets: