The easiest way to remove the whitespace is to remove it from the input.
<fo:block background-color = "red">
<fo:inline background-color="teal">The sky is blue</fo:inline>
<fo:inline background-color="purple">The grass is green</fo:inline>
</fo:block>
In xsl-fo whitespace is not all removed but collapsed that is a sequence of
whitespace is reduced to a single whitespace.
The details are a bit more complicated and you can control through
properties some of the behaviour. If you are familiar with HTML think about
xsl-fo whitespace handling as similar. So the below in html would be roughly
<div style="background-color:red">
<span style="background-color:teal">
The sky is blue
</span>
<span style="background-color:purple">
The grass is green
</span>
</div>
And would give you roughly the same rendering in a browser as your xsl-fo
gives you in pdf (or whatever output format you chose).
-----Original Message-----
From: lmhelp [mailto:[email protected]]
Sent: Tuesday, 21 April 2009 10:49 PM
To: [email protected]
Subject: fo:inline - Added extra spaces
Hi everyone,
Thank you for reading my post.
Have a look at the following piece of code:
We have:
- a "fo:block" element,
- and two "fo:inline" elements inside of it one after the other:
=====================================================
<fo:block background-color = "red">
<fo:inline background-color="teal">
The sky is blue
</fo:inline>
<fo:inline background-color = "purple">
The grass is green
</fo:inline>
</fo:block>
=====================================================
My problem is that:
(1) a white space is added at the end of the
string "The sky is blue" inside the "fo:inline"
element ;
(2) a white space is added at the beginning
of the string "The grass is green" inside the
"fo:inline" element ;
(3) there is also an extra space between the
two "fo:inline" elements.
For the third problem, I wrote the following to get
rid of the extra space (I put the second "fo:inline"
element inside the first one):
=====================================================
<fo:block background-color = "red">
<fo:inline background-color="teal">
The sky is blue
<fo:inline background-color = "purple">
The grass is green
</fo:inline>
</fo:inline>
</fo:block>
=====================================================
Do you know how to remove those white spaces (cases (1) and (2))?
If not, do you understand what is the logics behind it?
Thanks for your help,
--
Lmhelp
PS: Here is a gif image which illustrates the problem above:
http://www.nabble.com/file/p23157799/img_nabble_post.gif
--
View this message in context:
http://www.nabble.com/fo%3Ainline---Added-extra-spaces-tp23157799p23157799.h
tml
Sent from the FOP - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]