2
我正在使用XSL-FO和XML生成PDF。在文本框中,用戶可以輸入數據如「1」,然後按ENTER,然後按「2」,ENTER,「3」等。但在PDF中,輸出爲「1234567」。我如何保留換行符?我已經嘗試白空間崩潰,換行處理和空白處理但這並沒有幫助。換行(進入)即將進入XML。在使用XSL-FO生成的PDF中插入換行符
<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>
上面的評論有什麼意義? – mzjn
這個問題似乎是一個(不太完整)的這個副本: http://stackoverflow.com/questions/12294398/how-to-insert-line-breaks-in-a-pdf-generated-with-xsl -fo – RobertG