|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] How to filter characters from a string?
Hi all,
I'm practicing XSLT and decided to write my own Base 64 encoder and decoder templates. The rules for Base 64 Encoding say that only the following characters (in an encoded file) should be examined upon decoding: <xsl:variable name="base64Map" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZabcedfghijklmnopqrstuvwxyz01234567890+/='"/> This means that I would like to filter out every character that is not one of the 65 above characters. I realize that I could do this partially with translate(), but then I would need to specify every possible illegal character, of which there are thousands (if you have Unicode characters in there). A smaller version of such a command would be translate($encodedString, $base64Map, concat($base64Map, '=

 `~!@#$%^&*()-_)"'[]{}|\<>,.?;:')) Are there any templates or commands to delete any character from the first argument that DOESN'T appear in the second argument? I'm using Microsoft XSLT engine MSXSL4.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|






