How do I display output variable text in XSL

≯℡__Kan透↙ 提交于 2019-12-25 02:27:14

问题


I am using xsl:fo to generate a pdf using apache FOP, when I have come across the following issue:

        <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>

where bankDetails is a variable which contains entire paragraph of text with html tags. When I print it as is,it displays html tags literally(such as <p>, <br>, <ul><li> etc) instead of preserving the formatting.

How do I overcome this limitation ?

BankDetails is a variable, here is an example of a text which can be included(but not limited to) in BankDetails, the following text should render and not display with tags:

<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>

来源:https://stackoverflow.com/questions/52053037/how-do-i-display-output-variable-text-in-xsl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!