OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Stripping spaces with XSL



To normalize space in element-name, try normalize-space(): [1]

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

Normalization of space removes leading and trailing whitespace and smashes
sequences of more than one whitespace into a single space.

Good luck,
-Mike

p.s. try  http://www.mulberrytech.com/xsl/xsl-list for XSLT questions

[1] http://www.w3.org/TR/xpath#section-String-Functions

-----Original Message-----
From: Raphael Hertzog [mailto:rhertzog@hrnet.fr]
Sent: Wednesday, May 16, 2001 3:09 PM
To: xml-dev@lists.xml.org
Subject: Stripping spaces with XSL


Hi,

I want to strip all spaces (ie each sequence of spaces get into a single
space and trailing spaces are removed). I'm using the xsl:ouput element to
tell that I want to use the "text" output method. And I use the
xsl:strip-space element to tell on which element space should be stripped.

Despite this I still get uncessary spaces in the output. Both with xalan
(java version) and xsltproc (aka libxslt from Daniel Veillard used by
Gnome).

What did I miss ?

Cheers,

PS: Xalan-java is version 2.0.1. xsltproc is 0.9.0.
--
RaphaŽl Hertzog -+- http://strasbourg.linuxfr.org/~raphael/
Le bouche ŗ oreille du Net : http://www.beetell.com
Naviguez sans se fatiguer ŗ chercher : http://www.deenoo.com
Formation Linux et logiciel libre : http://www.logidee.com

------------------------------------------------------------------
The xml-dev list is sponsored by XML.org, an initiative of OASIS
<http://www.oasis-open.org>

The list archives are at http://lists.xml.org/archives/xml-dev/

To unsubscribe from this elist send a message with the single word
"unsubscribe" in the body to: xml-dev-request@lists.xml.org