[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: transform each character of a string

Subject: Re: transform each character of a string
From: Phil Lanch <phil@xxxxxxxxxxxxxxx>
Date: Mon, 31 Jan 2000 11:27:28 +0000
lanch product
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 &acirc;
> 2 is &ecirc;
> 3 is &icirc;
> and so on.
> 
> So when I have for example
> <mn>132</mn>
> in the source, I'd like to have
> &acirc;&icirc;&ecirc;
> 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.) &acirc; represents just one
character?

i.e. if you give your stylesheet a doctype

<!DOCTYPE xsl:stylesheet [
  <!ENTITY acirc  "&#226;">
  <!ENTITY ecirc  "&#234;">
  <!ENTITY icirc  "&#238;">
]>

then you can say

translate(.,'123','&acirc;&ecirc;&icirc;')

-- 

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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.