Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/EmptyTag/153.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用参数的两步XSLT转换_Xslt_Dynamic - Fatal编程技术网

使用参数的两步XSLT转换

使用参数的两步XSLT转换,xslt,dynamic,Xslt,Dynamic,我试图动态生成一个样式表,该样式表将输出使用参数的模板,但解析器试图在第一步中插入第二步的变量。 我将从XSLT转换到XSLT(别名为axsl),然后再转换到XSL-FO <xsl:template match="/"> <axsl:stylesheet version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format"> <axsl:template match="/">

我试图动态生成一个样式表,该样式表将输出使用参数的模板,但解析器试图在第一步中插入第二步的变量。 我将从XSLT转换到XSLT(别名为axsl),然后再转换到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>

我得到一个运行时错误,说“变量‘高度前的区域’尚未声明”。
正确的语法是什么使得{$region before height}只在第二次转换期间被解释?

我认为您需要双花括号:

<fo:region-before extent="{{$region-before-height}}"/>