You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by H....@MI.unimaas.nl on 2003/12/20 12:55:34 UTC
Removing extra spaces in xsl output
Hi,
How do I remove extra spaces around xsl:tags in the output HTML?
Example:
<number>
<nr1>123</nr1>
<nr2>345</nr2>
<nr3>678</nr3>
</number>
is transformed with:
<xsl:template match="number">
number = <xsl:value-of select="nr1"/>-<xsl:value-of
select="nr2"/>-<xsl:value-of select="nr3"/>
</xsl:template>
The output should be: 123-345-678
But instead its: 123 - 345 - 678
How do I remove the spaces around the - ? I've tried putting <xsl:text>
around them, but that doesn't solve the problem. Concatenate() is not an
option since I do some testing in the testing.
I know this is standard, but I can't remember the term I need.
Thanks.
Bye, Helma
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Removing extra spaces in xsl output
Posted by Jorg Heymans <jh...@domek.be>.
http://xml.apache.org/xalan-j/xsltc/xsl_whitespace_design.html
<xsl:strip-space elements="*"/>
H.vanderLinden@MI.unimaas.nl wrote:
> Hi,
>
> How do I remove extra spaces around xsl:tags in the output HTML?
>
> Example:
>
> <number>
> <nr1>123</nr1>
> <nr2>345</nr2>
> <nr3>678</nr3>
> </number>
>
> is transformed with:
>
> <xsl:template match="number">
> number = <xsl:value-of select="nr1"/>-<xsl:value-of
> select="nr2"/>-<xsl:value-of select="nr3"/>
> </xsl:template>
>
> The output should be: 123-345-678
> But instead its: 123 - 345 - 678
>
> How do I remove the spaces around the - ? I've tried putting <xsl:text>
> around them, but that doesn't solve the problem. Concatenate() is not an
> option since I do some testing in the testing.
>
> I know this is standard, but I can't remember the term I need.
>
> Thanks.
>
> Bye, Helma
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org