Gin*_*ead 3 xml xslt whitespace xsl-fo apache-fop
我正在实现FOP
使用XSLT
和XML
文件,我想保持单词之间的空白.
这是我的XML
样子:
<lines>
<line1> My Creation </line1>
<line2> address one AAAAAAAAAAA</line2>
<line3> This is the address of creation</line3>
<lines>
Run Code Online (Sandbox Code Playgroud)
以下是以下形式的结果PDF
:
My Creation
address one AAAAAAAAAAA
This is address of creation
Run Code Online (Sandbox Code Playgroud)
但我需要它像这样:
My Creation
address one AAAAAAAAAAA
This is the address of creation
Run Code Online (Sandbox Code Playgroud)
因此保留所有空间.我使用了以下行:
<xsl:preserve-space elements="*"/>
Run Code Online (Sandbox Code Playgroud)
但无济于事.
我用谷歌搜索解决方案,但徒劳无功.
任何帮助,将不胜感激.
<fo:block font-family="monospace" white-space="pre" text-align="left">
<xsl:value-of select="." />
</fo:block>
Run Code Online (Sandbox Code Playgroud)
white-space="pre"
将保留空白font-family="monospace"
将使空间的大小与角色的大小相等