From: "Elliotte Rusty Harold" <[EMAIL PROTECTED]>

> At 3:59 AM +0100 4/20/02, James Strachan wrote:
> >I've added 3 extension functions submitted by Mark Wilson. They are in
CVS
> >right now if anyone wants to play with them. I've added some XPath unit
test
> >cases in the usual place jaxen/xml/test/tests.xml so you can see them in
> >operation.
> >
>
> As written the uppercase() and lowercase() functions are
> locale-sensitive, and do not provide any means to choose the locale.

Agreed. Right now its the JVM's default locale which is not ideal.


> They may give different results on different systems with the same
> string. No means of choosing the locale is provided. An algorithm
> like the one used in XSLT2
> (http://www.w3.org/TR/xquery-operators/#func-upper-case) based on
> Unicode case mappings <http://www.unicode.org/unicode/reports/tr21/>
> might be more reliable or at least reproducible.

Thanks for the heads up Elliotte. I'll try figure out how to implement that
later this week. Incidentally to be more consistent with XSLT 2 I've renamed
the functions to upper-case() and lower-case().

Another idea could be to allow a second parameter to be specified with the
Locale to be used to convert the strings.

e.g.

upper-case( /foo/bar, $myLocale )

Then folks could put the locale to use in the VariableContext before
evaluating XPath expressions.

James


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


_______________________________________________
Jaxen-interest mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jaxen-interest

Reply via email to