我正在使用XSL和XML生成一个PDF。在文本框中,用户可以输入像"1“这样的数据,然后按ENTER,然后按"2",输入,"3”等等。但是在PDF中,输出是"1234567“。我怎样才能保留断线?我已经试过了“空域崩溃”、“线馈疗法”和“空白疗法”,但这并没有帮助。不过,行提要(enters)正在XML中出现。
<xsl:template match="AddCmt">
<fo:block keep-together="always"> Additional Comments
<fo:block-container border-style="solid" height="20mm" width="170mm" space-after="5mm">
<fo:block wrap-option="wrap" linefeed-treatment="preserve" white-space-collapse="false" white-space-treatment="preserve">
<xsl:attribute name="id">
<xsl:value-of select="../CMT_ID"/>
</xsl:attribute>
<xsl:value-of select="../ANS_CMT"/>
</fo:block>
</fo:block-container>
</fo:block> 发布于 2016-06-28 09:08:12
它应该使用以下xml (您应该添加所有属性):
<xsl:template match="AddCmt">
<fo:block keep-together="always"> Additional Comments
<fo:block-container border-style="solid" height="20mm" width="170mm" space-after="5mm">
<fo:block wrap-option="wrap" linefeed-treatment="preserve" white-space-collapse="false" white-space-treatment="preserve">
<xsl:attribute name="id">
<xsl:value-of select="../CMT_ID"/>
</xsl:attribute>
<xsl:value-of select="../ANS_CMT"/>
</fo:block>
</fo:block-container>
</fo:block>
</xsl:template> 如果您的XML已经没有换行符,那么您的PDF就不可能了。
https://stackoverflow.com/questions/13118280
复制相似问题