3

単語間の空白を残したいファイルFOPを使用XSLTして実装しています。 これは私のように見えます:XML
XML

   <lines>
        <line1>       My Creation       </line1>
        <line2>                                 address one AAAAAAAAAAA</line2>
        <line3>            This is the              address of creation</line3>
   <lines>

次の形式の結果は次のとおりですPDF

  My Creation
  address one AAAAAAAAAAA
  This is address of creation

しかし、私はそれがこのようである必要があります:

                My Creation       
                                          address one AAAAAAAAAAA
                     This is the              address of creation

したがって、すべてのスペースを保持します。私は次の行を使用しました:

  <xsl:preserve-space elements="*"/>

しかし、役に立たない。
私は解決策をグーグルで検索しましたが、無駄でした。
どんな助けでもいただければ幸いです。

4

1 に答える 1

5
<fo:block font-family="monospace" white-space="pre" text-align="left">
    <xsl:value-of select="." />
</fo:block>
  1. white-space="pre"空白を保持します
  2. font-family="monospace"キャラクターのサイズに対してスペースのサイズを等しくします
于 2012-08-07T05:46:01.813 に答える