home contribute faq download

FunctX XQuery Functions

fn:normalize-unicode

Normalizes according to a Unicode normalization form

Google
Webdatypic.com

Description

The fn:normalize-unicode function performs Unicode normalization, which allows text to be compared without regard to subtle variations in character representation. It replaces certain characters with equivalent representations. Two normalized values can then be compared to determine whether they are the same. Unicode normalization is also useful for allowing character strings to be sorted appropriately.

The $normalizationForm argument controls which normalization form is used, and hence which characters are replaced.

All implementations support the value NFC for $normalizationForm; some implementations may support other values.

This description is © Copyright 2007, Priscilla Walmsley. It is excerpted from the book XQuery by Priscilla Walmsley, O'Reilly, 2007. For a complete explanation of this function, please refer to Appendix A of the book.

Arguments and Return Type

NameTypeDescription
$arg xs:string? the string to normalize
$normalizationForm xs:string the normalization form
return value xs:string

Examples

XQuery ExampleResultsExplanation
normalize-unicode('query')
query
normalize-unicode('query', '')
query
normalize-unicode('', 'NFKC')
£ 
Converts £ to £.
normalize-unicode('leçon', 'NFKD')
lecon
Converts leçon to leçon. There are two characters in the output, a "c" and a separate cedilla, but they are probably not visible separately in your browser.
normalize-unicode('15 ㎗')
15 
normalize-unicode('15 ㎗', 'NFKC')
15 dl
Converts ㎗ to the letters 'dl'.

History

Published OnLast UpdatedContributor(s)
2006-06-272007-02-26W3C, XQuery 1.0 and XPath 2.0 Functions and Operators, http://www.w3.org/TR/xpath-functions/
Datypic XQuery Services

Recommended Reading:

XQuery