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 E S <al...@yahoo.com> on 2004/02/26 00:23:31 UTC

Removing white space

I am creating a stylesheet to render text from an xml
file and
have a loop like:
<xsl:for-each select="t">
    <xsl:apply-templates/>,
</xsl:for-each>

Now the source is:
<t>
  bla
</t>
<t>
  bla
</t>
<t>
  whatever
</t>

And I want to avoid the newlines to be passed through
to the output.
The output must be:
bla,bla,whatever

and NOT
bla
,bla
,whatever


How - please?
white-space-collapse ?

Thanks



__________________________________
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: Removing white space

Posted by Chris Bowditch <bo...@hotmail.com>.
<snip/>

> And I want to avoid the newlines to be passed through
> to the output.
> The output must be:
> bla,bla,whatever
> 
> and NOT
> bla
> ,bla
> ,whatever

There are many factors that cause this is to happen. First of all I need 
to see a bit of more of your XSL (not too big please)

> 
> 
> How - please?
> white-space-collapse ?

There is a section on the website about this:

http://xml.apache.org/fop/fo.html#fo-preformat

Chris



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: Removing white space

Posted by "J.Pietschmann" <j3...@yahoo.de>.
E S wrote:
> Now the source is:
> <t>
>   bla
> </t>
[snip]
> And I want to avoid the newlines to be passed through
> to the output.
> The output must be:
> bla,bla,whatever
> 
> and NOT
> bla
> ,bla
> ,whatever
> 
> 
> How - please?
> white-space-collapse ?

By default, newlines are *not* formatted as line breaks. Did
you actually try running FOP?

If you have to normalize whitespace during the transformation,
make yourself familiar with the normalize-space() function
  http://www.w3.org/TR/xpath#section-String-Functions

J.Pietschmann

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org