You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "michael.veeck" <Mi...@virtual-identity.com> on 2000/10/04 13:15:54 UTC

Newbie Question : Stripping LineFeed

Hy !
My problem is the following : 
I have to transform one xml in another xml-document using xslt (xalanJ D02
with xerces). The input-xml has elements with linefeeds in them which
shouldnt be in the output-file. SO I want to replace all Linefeeds with one
whitespace so that

<resource language="en">So that you&apos;ll never forget the one(s) you
love...

Artificial resin
Approx. 13 x 13 cm</resource>

becomes :

<resource language="en">So that you&apos;ll never forget the one(s) you
love... Artificial resin Approx. 13 x 13 cm </resource>

How can i tell the xalan-processor to do this ?
Thanks in Advance
Michael Veeck

Re: Newbie Question : Stripping LineFeed

Posted by Fergus Gallagher <Fe...@OrbisUK.com>.
There is the function "normalize-space()"

e.g.,

         <xsl:value-of select="normalize-space()"/>

strips leading & trailing whitespace & replaces internal whitespace with 
single space character.

Seems to be what you need

Fergus


At 13:15 04/10/00 +0200, michael.veeck wrote:
>Hy !
>My problem is the following :
>I have to transform one xml in another xml-document using xslt (xalanJ D02
>with xerces). The input-xml has elements with linefeeds in them which
>shouldnt be in the output-file. SO I want to replace all Linefeeds with one
>whitespace so that
>
><resource language="en">So that you&apos;ll never forget the one(s) you
>love...
>
>Artificial resin
>Approx. 13 x 13 cm</resource>
>
>becomes :
>
><resource language="en">So that you&apos;ll never forget the one(s) you
>love... Artificial resin Approx. 13 x 13 cm </resource>
>
>How can i tell the xalan-processor to do this ?
>Thanks in Advance
>Michael Veeck

-- 
Fergus Gallagher
Orbis
http://www.orbisuk.com/
+44-(0)20-8987 0717