This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: looking for the / char


From: Mike Brown <mike@skew.org>
Message-Id: <200102041718.f14HIT209410@skew.org>
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@lists.mulberrytech.com
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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]