|
Subject: Re: Character numbers From: David_Marston@xxxxxxxxx Date: Fri, 11 Aug 2000 10:31:25 -0400 |
Ewout Kanger writes:
>I am looking for a way to retrieve character numbers:
>example:
>If a string is 'A' I want 65,...
This doesn't look like an ideal job for XSLT, which
generally covers up those things. You could write an
extension function for it. If the list of characters
is suitably small, you could do something like:
<xsl:variable name="charnum"><xsl:choose>
<xsl:when test="$char = 'A'">65</xsl:when>
<xsl:when test="$char = 'B'">66</xsl:when>
<xsl:when test="$char = 'C'">67</xsl:when>
...
<xsl:otherwise>-1</xsl:otherwise>
</xsl:choose></xsl:variable>
Why do you want this, anyway? Perhaps your larger task
can be accomplished in a better way.
.................David Marston
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Character numbers, Ewout Kanger | Thread | XSLT and formatters, Hans-Guenter Stein |
| Re: xsl:namespace-alias in Xalan, Paul_Dick | Date | RE: Search and Replace in XSLT, Jeni Tennison |
| Month |