xsl-list
[Top] [All Lists]

Re: [xsl] Filename encoding

2009-10-21 08:44:19
I think I will go for

 translate($some_filename,
 'abcdefghijklmnopqrstuvwxyz0123456789',
 'opqstuavwk7mxyghijlr6z01234cbd5ef89n')

in XSLT, and

        string x = "some_filename";
        x = x.Replace("a", "o");
        x += x.Replace("b", "p");
        x += x.Replace("c", "q");
        x += x.Replace("d", "s");
        x += x.Replace("e", "t");
        x += x.Replace("f", "u");
        x += x.Replace("g", "a");
        x += x.Replace("h", "v");
        x += x.Replace("i", "w");
        x += x.Replace("j", "k");
        x += x.Replace("k", "7");
        x += x.Replace("l", "m");
        x += x.Replace("m", "x");
        x += x.Replace("n", "y");
        x += x.Replace("o", "g");
        x += x.Replace("p", "h");
        x += x.Replace("q", "i");
        x += x.Replace("r", "j");
        x += x.Replace("s", "l");
        x += x.Replace("t", "r");
        x += x.Replace("u", "6");
        x += x.Replace("v", "z");
        x += x.Replace("w", "0");
        x += x.Replace("x", "1");
        x += x.Replace("y", "2");
        x += x.Replace("z", "3");
        x += x.Replace("0", "4");
        x += x.Replace("1", "c");
        x += x.Replace("2", "b");
        x += x.Replace("3", "d");
        x += x.Replace("4", "5");
        x += x.Replace("5", "e");
        x += x.Replace("6", "f");
        x += x.Replace("7", "8");
        x += x.Replace("8", "9");
        x += x.Replace("9", "n");

in C#...

Damned that I can't use XSLT for it all!

Cheers,
Jepser

--~------------------------------------------------------------------
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>