Re: [xsl] looking for the / char

Subject: Re: [xsl] looking for the / char
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx (by way of Mulberry Technologies List Owner)
Date: Sun, 4 Feb 2001 17:51:27 -0500
From: Mike Brown <mike@xxxxxxxx>
Message-Id: <200102041718.f14HIT209410@xxxxxxxx>
Subject: Re: [xsl] looking for the / char
In-Reply-To: <a05001905b6a283b22ed3@[192.168.254.9]> "from by way of Mulberry
 Technologies List Owner at Feb 3, 2001 10:58:03 pm"
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Date: Sun, 4 Feb 2001 10:18:28 -0700 (MST)
X-Mailer: ELM [version 2.4ME+ PL84 (25)]
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII

 Im trying to get a template that will just remove spaces and / from a given
 string.

The substring replacement template in the FAQ is overkill for your needs.


XPath provides a nice translate() function that will replace all occurrences
of one single character in a string with another character. Example:

<xsl:value-of select="translate($stringIn,'/ ','')"/>

See http://www.w3.org/TR/xpath#section-String-Functions

   - Mike
____________________________________________________________________
Mike J. Brown, software engineer at            My XML/XSL resources:
webb.net in Denver, Colorado, USA              http://skew.org/xml/

XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


Current Thread