xsl-list
[Top] [All Lists]

RE: [xsl] Selectively Applying use-character-maps

2011-02-27 12:00:12
Oops! Forgot about that one. That's exactly what I need. Vielen Dank!

-----Original Message-----
From: Wolfgang Laun [mailto:wolfgang(_dot_)laun(_at_)gmail(_dot_)com] 
Sent: Sunday, February 27, 2011 12:05 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] Selectively Applying use-character-maps

The function fn:translate does what you need, e.g.,
   fn:translate( "a cab", "abc", "1234" ) returns "1 312"
-W


On 27 February 2011 17:48, Tony Nassar <tnassar(_at_)palantir(_dot_)com> wrote:

As far as I can tell from XSLT 2.0 specification, there's no way to serialize 
text now as Latin, now as Devanagari. Is that correct? Unfortunately the 
samples I have aren't distributable, so I hope this example will do. Let's 
say I have some XML like this:

<document>
            <paragraph>Hello, world!</paragraph>
            <paragraph font="Kruti">poiuiertpoi%&(*</paragraph>
</document>

Kruti is a pre-Unicode mapping of single bytes to Devanagari characters. I 
need to map the bytes above (which are the same as the values used in the 
ASCII encoding of Latin characters) to Devanagari characters when, and only 
when, @font eq 'Kruti'.

Clearly, I can write an XSLT 2.0 function to get the code points for 
paragraph[@font eq 'Kruti'] and map them to the UTF-16 values myself. Is 
there any easier way to do this?

Tony Nassar Ph.D.
Palantir Technologies | Forward Deployed Engineer
tnassar(_at_)palantirtech(_dot_)com | 650-387-6502 | Pager 888-913-2793


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>