DesignLiquido / xslt-processor

A JavaScript XSLT processor without native library dependencies
GNU Lesser General Public License v3.0
95 stars 30 forks source link

Upper and Lower case #33

Closed JonathanRowell closed 8 months ago

JonathanRowell commented 4 years ago

XSLT 1.0 has a MAJOR flaw in that it has no upper/lower case conversion without resorting to "translate", which only solves half the problem.

XSLT 2.0 has native functions just like Javascript which solve the whole problem.

These two functions ought to be simple to implement. Could you add them please?

leonelsanchesdasilva commented 11 months ago

Hi @JonathanRowell. Can you please provide usage examples of what you imagine it should be the behavior?

JonathanRowell commented 11 months ago

The best reference for the behavior of upper-case() is given in the O'Reilly book XSLT 2.0 (https://www.oreilly.com/library/view/xslt-2nd-edition/9780596527211/re176.html). It is also contained in the XQuery standard see Priscilla Walmsley 'sbook (again O'Reilly) page 627. I use it in comparison cases of bibliographic data to find out whether Antonin Dvorak is in fact Ántonin Dvořák. The same with Greek, Russian and a host of other names. Convert to upper case (difficult without using complete Unicode) and then throw away the accents (easy with translate).