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

looking for the / char

Subject: looking for the / char
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx (by way of MulberryTechnologies List Owner)
Date: Sat, 3 Feb 2001 22:58:03 -0500
replacecharsinstring
From: "Mirick, John" <jmirick@xxxxxxxxxxxx>
To: "'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'" <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject: looking for the / char
Date: Fri, 2 Feb 2001 14:52:48 -0500
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain;
	charset="iso-8859-1"

Eck! Im a bit baffled right now...
Im trying to get a template that will just remove spaces and / from a given
string. The code is based on some I found in the FAQ. It replaces the spaces
fine.... however it wont replace the /.... Im not sure why.
If anyone has a spare moment Im sure it is blatantly obvious to some of you.
But Im at the point where Im ready to pull my hair out. I have also tried
both the decimal and hex codes (&#47; and &#x2f;) rather than just using the
slash with no luck.
-john

<xsl:template name="replaceCharsInString">
	<xsl:param name="stringIn"/>
	<xsl:choose>
		<xsl:when test="contains($stringIn,' ')">
			<xsl:value-of
select="concat(substring-before($stringIn,' '),'%20')"/>
			<xsl:call-template name="replaceCharsInString">
				<xsl:with-param name="stringIn"
select="substring-after($stringIn,' ')"/>
			</xsl:call-template>
		</xsl:when>
		<xsl:when test="contains($stringIn,'/')">
			<xsl:message>2</xsl:message>
			<xsl:value-of
select="concat(substring-before($stringIn,'/'),'%2f')"/>
			<xsl:call-template name="replaceCharsInString">
				<xsl:with-param name="stringIn"
select="substring-after($stringIn,'/')"/>
			</xsl:call-template>
		</xsl:when>
		<xsl:otherwise>
			<xsl:value-of select="$stringIn"/>
		</xsl:otherwise>
	</xsl:choose>
</xsl:template>

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


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.