|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Converting to ASCII equivalent
> 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.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








