|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] string handling
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








