Created
December 9, 2016 19:38
-
-
Save ubermichael/167a0ff8ed8cbe283c5fa563efd3931f to your computer and use it in GitHub Desktop.
Normalize unicode by calling java native functions in eXist 2.2 where normalize-unicode() doesn't work.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "3.0"; | |
(: | |
Sadly, the eXist 2.2 normalize-unicode() function is broken. So we call out | |
to the java one. | |
:) | |
declare namespace normalizer = "java:java.text.Normalizer"; | |
declare namespace form = "java:java.text.Normalizer$Form"; | |
declare function local:normalize($string as item()) as xs:string { | |
normalizer:normalize($string, form:value-of('NFD')) | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment