replacing characters in a string

Subject: replacing characters in a string
From: Linda van den Brink <lvdbrink@xxxxxxx>
Date: Fri, 15 Oct 1999 13:52:46 +0200

After reading Michel Goosens mail about "how to get an apostrophe into a
test expression" and Mike Kay's answer, I've been trying to do something

<xsl:variable name="v1" select="string(name)"/>
<xsl:variable name="v2">
		<xsl:when test='substring($v1, 1)="&apos;"'>
			<xsl:value-of select="substring-before"/>
			<xsl:value-of select="substring-after"/>
			<xsl:value-of select="$v2"/>

What I want this to do is convert the (contents of the) 'name' element in my
XML to a string, see if there's an apostrophe character, if so, convert this
to \', if not, just output the value of 'name'. ($v2 is used in a parameter
for a javascript function). 

But I always get the value of 'name'. I tried other tests, but the tests
always fail. 

Any insights? 


 XSL-List info and archive:

Current Thread