|
Subject: string handling From: Jeff Lansing <jeff@xxxxxxxx> Date: Tue, 25 Apr 2000 17:49:37 -0700 |
Here's an interesting asymetry in how you have to process strings with
XSLT/XPath:
<xsl:variable name="string" select="'hyperfitness'"/>
<xsl:variable name="unprefixed-string">
<xsl:if test="starts-with($string, 'hyper')">
<xsl:value-of select="substring-after($string, 'hyper')"/>
</xsl:if>
<xsl:if test="not(starts-with($string, 'hyper'))">
<xsl:value-of select="$string"/>
</xsl:if>
</xsl:variable>
<xsl:variable name="unsuffixed-string"
select="substring-before(concat($string, 'ness'), 'ness')"/>
<xsl:value-of select="concat($unsuffixed-string, ' ',
$unprefixed-string)"/>
Of course the idea is not to get null variables when the input string
lacks the prefix/suffix.
Jeff
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| RE: templates around templates., Igor Nakshin | Thread | Re: Web Connection, Scott Boag/CAM/Lotus |
| templates around templates., Jay Marvin | Date | Re: Displaying every 2 element valu, Mike Brown |
| Month |