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

Re: Filename encoding

Subject: Re: Filename encoding
From: Hermann Stamm-Wilbrandt <STAMMW@xxxxxxxxxx>
Date: Wed, 21 Oct 2009 16:00:46 +0200
Re:  Filename encoding
Jesper,

I do not know C#, but it looks like it always needs to be "x = x.Replace
(...)" ...

And the sequential nature of your algorithm will replace 'w' by 'e' and not
by '0' as in the XSLT translate ...

w --> 0 --> 4 --> 5 --> e


Mit besten Gruessen / Best wishes,

Hermann Stamm-Wilbrandt
Developer, XML Compiler
WebSphere DataPower SOA Appliances
----------------------------------------------------------------------
IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschaeftsfuehrung: Erich Baier
Sitz der Gesellschaft: Boeblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294


                                                                           
             Jesper Tverskov                                               
             <jesper.tverskov@                                             
             gmail.com>                                                 To 
                                       xsl-list@xxxxxxxxxxxxxxxxxxxxxx     
             10/21/2009 02:43                                           cc 
             PM                                                            
                                                                   Subject 
                                       Re:  Filename encoding         
             Please respond to                                             
             xsl-list@xxxxxxxx                                             
              lberrytech.com                                               
                                                                           
                                                                           
                                                                           




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

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.