使用FOP在生成的PDF中保留空格

Gin*_*ead 3 xml xslt whitespace xsl-fo apache-fop

我正在实现FOP使用XSLTXML文件,我想保持单词之间的空白.
这是我的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)

但无济于事.
我用谷歌搜索解决方案,但徒劳无功.
任何帮助,将不胜感激.

Gin*_*ead 5

<fo:block font-family="monospace" white-space="pre" text-align="left">
    <xsl:value-of select="." />
</fo:block>
Run Code Online (Sandbox Code Playgroud)
  1. white-space="pre" 将保留空白
  2. font-family="monospace" 将使空间的大小与角色的大小相等