Subject: Re: transform each character of a string
From: Phil Lanch <phil@xxxxxxxxxxxxxxx>
Date: Mon, 31 Jan 2000 11:27:28 +0000
|
Frederic Schwebel wrote:
>
> Hi everybody, I'm (still) working on an XSLT sheet to transform MathML
> into french Braille for Blind people to access it.
> The numbers (1 to 0) have a Braille code corresponding to letters with
> accents when they're in a mathematical context.
> Examples :
> 1 is â
> 2 is ê
> 3 is î
> and so on.
>
> So when I have for example
> <mn>132</mn>
> in the source, I'd like to have
> âîê
> in the HTML output.
>
> I know there is the "translate" function, but it seems to work only for a
> 1 on 1 traduction....
surely this is 1 on 1, because (e.g.) â represents just one
character?
i.e. if you give your stylesheet a doctype
<!DOCTYPE xsl:stylesheet [
<!ENTITY acirc "â">
<!ENTITY ecirc "ê">
<!ENTITY icirc "î">
]>
then you can say
translate(.,'123','âêî')
--
cheers
phil
"When they bring me fear soup to eat,
I try not to eat it, I try to send it back.
But sometimes I'm too afraid to and have to eat it anyway."
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|