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

RE: Converting to ASCII equivalent

Subject: RE: Converting to ASCII equivalent
From: iwantto keepanon <iwanttokeepanon@xxxxxxxx>
Date: Wed, 24 Aug 2005 01:13:16 +0400 (MSD)
converting to ascii
> IMHO no extension would be needed if the OP was willing to invest 
> the time in preparing the ASCII table in xml format. 
 
A table is not really necessary either.  This could easily be expanded 
into what the OP wanted: 
 
<xsl:variable name="char-ranking">  
<![CDATA[  
ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz 
]]>  
</xsl:variable>  
 
<xsl:variable 
   name="char-ord" 
   select="63 + string-length(substring-before($char-ranking,substring($str1, 1, 1)))"  
/> 
 
Note: if $char-ord == 63, then character not found.  If character not 
found, then just copy the char into your output string.  Make sure 
char-ranking contains all possible characters you might want to 
translate into ASCII values. 
 
But recursion is still necessary to process the whole string.  Using 
CDATA, you can represent the entire ASCII chart ... expanding the 
solution is left up to the poster  ;-) 
 
P.S. I'd love to say I invented the ranking technique, but I saw it in 
a 'strcmp' implementation once. 
 
-- 
Rodman

P.P.S. sorry if this is double posted ... having email problems.

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.