Subject: RE: translate function & hex data From: Mike Brown <mbrown@xxxxxxxxxxxxx> Date: Mon, 28 Feb 2000 14:41:17 -0700 |
Paul Bell wrote: > Is it possible to specify a hexadecimal value (00-ff) > as the third argument to the translate function? > My larger goal is to translate backslashes that would > appear in a Windows filesystem path to a given byte value. Well, you can't refer to bytes, per se, because XPath and XSLT functions operate on the data model prescribed in the XPath spec. This model does not deal with bytes; it deals with nodes, and (following the reference to the XML Infoset spec) at a lower level, with Unicode/UCS characters, regardless of how they are represented when serialized as a byte stream. Since an XML parser will resolve character references before the stylesheet tree is built, you should be able to put any Unicode characters in the arguments to the translate() function. For example, translate($someString,'abcde','ABCDE') is the same as ($someString,'abcde','ABCDE'). If your goal is to output bytes that represent characters from the Windows CP-1252 (or whatever) character set, you'll need to determine what the proper Unicode/UCS code points are for those characters, and then rely on your serialization mechanism to encode the characters as the bytes you want. It may take some experimentation depending on your particular situation. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
translate function & hex data, Paul Bell | Thread | Re: translate function & hex data, Paul Bell |
RE: Trying to learn XSL, Respess, Christe | Date | xpath question, Brian Dupras |
Month |