Re: finding character code from string

Mike Brown <[email protected]>
Newsgroups gmane.text.xml.xslt.extensions
Message-ID <[email protected]>
Geoff Richards wrote:
> This has probably been asked before, but are there any plans
> for adding an EXSLT function for retrieving the Unicode character
> code of a character (i.e., a string of length 1)?
> 
> Something like this perhaps:  str:character-code('a')

I don't think there are any new functions/elements pending.

+1 if you want to write a proposal (actually spec it out and post it here).
Personally, I wouldn't hesitate to implement it, it's so easy. 

If you write a proposal, you might want to base it on XPath 2.0's
fn:string-to-codepoints() [1], although this would require you to return a
node-set, in order to give the codes for more than one character. There is a
precedent for doing it that way, though.

-Mike

 [1] http://www.w3.org/TR/xquery-operators/#func-string-to-codepoints
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.