0
我將Java代碼中的幾個參數傳入我的XSL樣式表中,用於使用XSL生成PDF:FO,但出現此錯誤:XSLT:XTSE0010:一個fo:block元素不能包含一個xsl:param元素
XTSE0010: An fo:block element must not contain an xsl:param element
這是我的樣式表(部分):
<fo:flow flow-name="xsl-region-body">
<fo:block>
<xsl:value-of select="reportContent/client/clientId"/>
</fo:block>
<fo:block font-weight="bold">
<xsl:value-of select="reportContent/client/clientName" />
</fo:block>
<fo:block>
<xsl:value-of select="reportContent/client/clientAddress" />
,<xsl:value-of select="reportContent/client/clientTown" />
</fo:block>
<fo:block>
<xsl:value-of select="reportContent/reportInterval/startDate"/>
- <xsl:value-of select="reportContent/reportInterval/endDate"/>
</fo:block>
<fo:block page-break-inside="auto">
<fo:table>
<fo:table-body>
<fo:table-row>
<fo:table-cell>
<fo:block/>
</fo:table-cell>
</fo:table-row>
<xsl:for-each select="reportContent/batch">
<fo:table-row>
<fo:table-cell padding="3px">
<fo:block>
<xsl:param name="clientId" />
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:for-each>
</fo:table-body>
</fo:table>
</fo:block>
</fo:flow>
有什麼辦法,我可以用我的xsl:fo
標籤內的參數?
是的,'的xsl:for傳遞到樣式表的參數param'聲明必須是一個'頂層'元素(https://www.w3.org/TR/xslt#top-level-variables,https://www.w3.org/TR/xslt#dt-top-level),即,是'xsl:stylesheet'元素的子元素。 –