如何在XSL中显示输出变量文本

时间:2018-08-28 08:09:22

标签: xml xslt xsl-fo apache-fop

遇到以下问题时,我正在使用xsl:fo使用apache FOP生成pdf:

        <fo:table-cell
xsl:use-attribute-sets="btInfo mt10pt mb10pt">
<fo:block text-align="left" linefeed-treatment="preserve">
<xsl:text disable-output-escaping="yes"><xsl:value-of
select="BankDetails" />
</xsl:text>
</fo:block>
</fo:table-cell>

其中bankDetails是一个变量,其中包含带有html标签的整个文本段落。 当我按原样打印时,它按原样显示html标签(例如<p>, <br>, <ul><li>等),而不保留格式。

如何克服此限制?

BankDetails是一个变量,这是可以包含在(但不限于)BankDetails中的文本的示例,以下文本应呈现且不与标签一起显示:

<ul style="list-style-position: inside;">
<li>Relying on provisions of the Motor Vehicles Act 1988, Justice R Devdas noted that as per section 147(2), the maximum liability in respect of damages caused to any third party was Rs 6,000, and that the Motor Accidents Claims Tribunal (MACT),&nbsp;</li>
<li>Bengaluru hadn’t taken into account relevant factors before awarding Rs 75,000 as compensation.</li>
<li>Suhas R Reddy’s car had suffered extensive damage after it collided with the bus on March 9, 2009. Suhas claimed compensation under ‘own damages’ from his vehicle’s insurer, Royal Sundaram Alliance Insurance, and was paid Rs 1,18,420.</li>
</ul>

0 个答案:

没有答案