|
Subject: Re: [xsl] String cleaning in XSLT and XQuery From: Martin Honnen <Martin.Honnen@xxxxxx> Date: Tue, 21 Dec 2010 12:14:30 +0100 |
<xsl:function name="jc:cleanString" as="xs:string">
<xsl:param name="string"/>
<xsl:variable name="cleanedString">
<xsl:analyze-string select="lower-case(normalize-space($string))"
regex="[a-zA-Z0-9\s]+">
<xsl:matching-substring><xsl:value-of select="translate(., '
', '_')"/></xsl:matching-substring>
<xsl:non-matching-substring/>
</xsl:analyze-string>
</xsl:variable>
<xsl:value-of select="$cleanedString"/>
</xsl:function>
a) Am I doing this in a good way? Anything I've overlooked? (Always happy to get tips on making things that already work better!)
Martin Honnen http://msmvps.com/blogs/martin_honnen/
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] String cleaning in XSLT and X, James Cummings | Thread | Re: [xsl] String cleaning in XSLT a, James Cummings |
| [xsl] String cleaning in XSLT and X, James Cummings | Date | Re: [xsl] String cleaning in XSLT a, James Cummings |
| Month |