You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by "Al-Dhahir, Haitham" <Ha...@gs.com> on 2002/07/23 15:57:01 UTC

Preserving space in fo:block

Hi,

I have an fo block with the following layout:

<fo:block text-align="left" white-space-treatment="preserve">
	<xsl:value-of select="X/@val"/> <xsl:value-of select="Y/@val"/>
</fo:block>

I am trying to get a space to appear between the two select values, i.e.
"value_of_X<space>value_of_Y". However what I am getting is
"value_of_Xvalue_of_Y". I have put white-space-treatment="preserve" into the
block header to try to remedy this but it has not helped. Does anyone know
how I can make sure a space appears between the two values?

Thanks,

Haitham.


                	

Re: Preserving space in fo:block

Posted by Oleg Tkachenko <ol...@multiconn.com>.
Al-Dhahir, Haitham wrote:

> I have an fo block with the following layout:
> 
> <fo:block text-align="left" white-space-treatment="preserve">
> 	<xsl:value-of select="X/@val"/> <xsl:value-of select="Y/@val"/>
> </fo:block>
> 
> I am trying to get a space to appear between the two select values, i.e.
> "value_of_X<space>value_of_Y". However what I am getting is
> "value_of_Xvalue_of_Y". I have put white-space-treatment="preserve" into the
> block header to try to remedy this but it has not helped. Does anyone know
> how I can make sure a space appears between the two values?

I believe that's not fop's fault, rather it's default xslt whitespace handling.
Unless you specify otherwise in xslt stylesheet, all "whitepace only text 
nodes" are stripped out from stylesheet tree, except those inside <xsl:text> 
instruction. See http://www.w3.org/TR/xslt.html#strip fro more info.
You can use therefore
<xsl:value-of select="X/@val"/><xsl:text> </xsl:text><xsl:value-of 
select="Y/@val"/>

-- 
Oleg Tkachenko
Multiconn International, Israel


Re: Preserving space in fo:block

Posted by Balaji Loganathan <ba...@yahoo.com>.
You can use xsl:text
or u can use
concat(X/@val,' ',Y/$val)
or u can use
white-space-collapse="false" or "true"in fo:block.
Regards
Balaji

best option is using xsl:text

 --- "Al-Dhahir, Haitham" <Ha...@gs.com>
wrote: > Hi,
> 
> I have an fo block with the following layout:
> 
> <fo:block text-align="left"
> white-space-treatment="preserve">
> 	<xsl:value-of select="X/@val"/> <xsl:value-of
> select="Y/@val"/>
> </fo:block>
> 
> I am trying to get a space to appear between the two
> select values, i.e.
> "value_of_X<space>value_of_Y". However what I am
> getting is
> "value_of_Xvalue_of_Y". I have put
> white-space-treatment="preserve" into the
> block header to try to remedy this but it has not
> helped. Does anyone know
> how I can make sure a space appears between the two
> values?
> 
> Thanks,
> 
> Haitham.
> 
> 
>                 	 

http://www.sold.com.au - SOLD.com.au
- Find yourself a bargain!