[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Help me out on Removing the blankspaces from a te

Subject: RE: Help me out on Removing the blankspaces from a textarea
From: "Andrew Welch" <ajwelch@xxxxxxxxxxxxxxx>
Date: Wed, 20 Oct 2004 13:15:59 +0100
xslt remove new line
Hi,

To replace all occurances of a string with another string in XSLT 1.0
you will need to use a recursive template.

You can find some examples here:
http://www.dpawson.co.uk/xsl/sect2/replace.html

In XSLT 2.0 you can use Xpath 2.0's replace() function:

<xsl:value-of select="replace(.,'@{3}','&#xa;')"/>

cheers
andrew



> Jarno and All,
>
> I had introduced JavaScript in the xsl to replace All the @@@
> chars in the String. Using RegEx is introducing blankspaces
> along with the new line. I wish to know, how do i
> replace all the @@@ chars in a String in xsl.
>
> Is My Approach using the RegEx is Ok. Or using xml/xsl is a
> better way. Pls Advice
>
> Thanks
> Ashfaq
> -----Original Message-----
> From: Jarno.Elovirta@xxxxxxxxx [mailto:Jarno.Elovirta@xxxxxxxxx]
> Sent: Wednesday, October 20, 2004 12:52 PM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE:  Help me out on Removing the blankspaces
> from a textarea
>
>
> Hi,
>
> > I have to replace the "@@@" with a new '\ln' in the document
> > which is dynamic.
> >
> > I guess translate does not work
> > --------------------------------------------------------------
> > ------------------------
> > function replaceString() {
> > 	regX = new RegExp("\@@@","g") ;
> >
> > document.form1.TextArea.value=document.form1.TextArea.value.re
> > place(regX,"\n");
> > --------------------------------------------------------------
> > ------------------------
>
> Is your question how to replace strings with ECMAScript? You
> should probably then post to some other list, as this is an
> XSL/XSLT/XPath list.
>
> Cheers,
>
> Jarno - Chris C: Vengeance Is Mine

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.