Subject: Re: [xsl] Escaping a utf-8 string From: Mike Brown <mike@xxxxxxxx> Date: Sat, 17 Aug 2002 14:05:02 -0600 (MDT) |
Wesley W. Terpstra wrote: > Again, all would be simple if only I could extract a hexademincal encoding > of the utf-8 string in some way. Getting the ascii numeric value would work, > or in fact, a function like "hexify" or something that takes the string and > just output AB87B3AF873E or something would be fine since I could then stick > =s and %s in the stream appropriately. > > Does anyone know of a way to get past this barrier in xsl? This isn't the solution to your problem, but it might give you some ideas: http://skew.org/xml/stylesheets/url-encode/ It essentially uses string-length() and substring-before() to find the index of a character in a string, then applies a little arithmetic on that number to arrive at character indices in another string to produce the output. If your goal is to produce UTF-8 sequences, it will be a little trickier, and you are going to have to decide what reasonable subset of Unicode is worth supporting in this manner, but it should be possible in pure XSLT. - Mike ____________________________________________________________________________ mike j. brown | xml/xslt: http://skew.org/xml/ denver/boulder, colorado, usa | resume: http://skew.org/~mike/resume/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Escaping a utf-8 string, Wesley W. Terpstra | Thread | Re: [xsl] Escaping a utf-8 string, Wesley W. Terpstra |
[xsl] netscape vs IE in document.lo, Bruce Gagnon | Date | Re: [xsl] Escaping a utf-8 string, Wesley W. Terpstra |
Month |