Subject: RE: [xsl] 'fn:normalize-space', but with 0 or 1 heading/trailing space From: "Michael Kay" <mike@xxxxxxxxxxxx> Date: Tue, 27 Dec 2005 20:47:11 -0000 |
Use concat() to add a non-space character (e.g. "#") fore and aft, then apply normalize-space(), then strip off the leading and trailing "#" using substring(). Or in XPath 2.0, just do replace($in, '\s+', ' ') Michael Kay http://www.saxonica.com/ > -----Original Message----- > From: Florent Georges [mailto:darkman_spam@xxxxxxxx] > Sent: 27 December 2005 17:29 > To: XSL Mulberry list > Subject: [xsl] 'fn:normalize-space', but with 0 or 1 > heading/trailing space > > Hi > > I need a function similar to 'fn:normalize-space', but > that not strip the heading and leading space if present > (more precisely I want one space if one or more heading or > leading whitespace is present). > > Do I need to code this entire function from scratch, or > to use 'fn:normalize-space' and add myself a space if I > detect any whitespace, or to... use a better solution? > > Regards, > > --drkm > > > > > > > > > > > > > > > > > > > > > > > ______________________________________________________________ > _____________ > Nouveau : tiliphonez moins cher avec Yahoo! Messenger ! > Dicouvez les tarifs exceptionnels pour appeler la France et > l'international. > Tilichargez sur http://fr.messenger.yahoo.com
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] 'fn:normalize-space', but wit, Florent Georges | Thread | [xsl] Splitting already-grouped out, Asparagirl |
RE: [xsl] Splitting already-grouped, cknell | Date | RE: [xsl] removing namespace, Michael Kay |
Month |