This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Converting number to ASCII-character
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] Converting number to ASCII-character
- From: "Michael Kay" <mhkay at iclway dot co dot uk>
- Date: Mon, 24 Sep 2001 09:29:29 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
> I have a variable, which contains a number and I want to output the
> appropriate
> ASCII- charater.
> For example
>
> <xsl:variable name = "number" select = "65"/>
>
> should output an A.
> Is there a function or something similar to solve this issue ?
The closest equivalent is:
<xsl:value-of select="concat('&', $number, ';')"
disable-output-escaping="yes"/>
which works because Unicode character values are a superset of ASCII.
If you want to avoid d-o-e, you can
(a) escape into an extension function
(b) use
<xsl:variable name="ascii"> !"#$%^....abcde...ABCDE....</xsl:variable>
<xsl:value-of select="substring($ascii, $number - 31, 1)"/>
Mike Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list