Reputation: 8230
I'm implementing FOP
using XSLT
and XML
files where I want to keep the white spaces between words.
This is how my XML
looks like:
<lines>
<line1> My Creation </line1>
<line2> address one AAAAAAAAAAA</line2>
<line3> This is the address of creation</line3>
<lines>
What follows is The result in the form of PDF
:
My Creation
address one AAAAAAAAAAA
This is address of creation
But I need it to be like this:
My Creation
address one AAAAAAAAAAA
This is the address of creation
Hence preserving all spaces. I used the following line:
<xsl:preserve-space elements="*"/>
But to no avail.
I googled for solutions but in vain.
Any help would be appreciated.
Upvotes: 3
Views: 3775
Reputation: 8230
<fo:block font-family="monospace" white-space="pre" text-align="left">
<xsl:value-of select="." />
</fo:block>
white-space="pre"
will preserve the whitespacesfont-family="monospace"
will equalize the spaces' sizes with respect
to that of the characters'Upvotes: 6