3
我正在维护一个xsl-fo文件。我既不擅长xslt,也不在xsl-fo,每年我只接触一次该文件。如何重新使用xsl-fo块?
我注意到该文件中有很多重复。例如,我在不同的上下文中有两次(逐字)确切区块:
<xsl:if test="ReleaseNote!=''">
<fo:block background-color="#ffeeee" padding="5mm" font-size="12pt" text-indent="0" border-style="solid" border-width="1px" border-color="red">
<fo:table table-layout="fixed" width="100%">
<fo:table-column column-width="20mm" />
<fo:table-column column-width="135mm" />
<fo:table-body>
<fo:table-row>
<fo:table-cell margin="0" padding="0" text-align="justify">
<fo:block text-align="justify">
<fo:external-graphic src="pic/warning.png" content-width="12mm" content-height="12mm" />
</fo:block>
</fo:table-cell>
<fo:table-cell margin="0" padding="0">
<fo:block linefeed-treatment="preserve">
<xsl:value-of select="ReleaseNote" />
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block>
</xsl:if></fo:block>
如何删除此重复?我可以预先定义这个块,然后在xslt中重新使用它的“引用”吗?
可能重复[如何在XSL中重复使用代码](http://stackoverflow.com/questions/15711840/how-can-i-reuse-code-in-xsl) –