XSLT and XPath function reference in alphabetical order
(Excerpt from “XSLT 2.0 & XPath 2.0” by Frank Bongers, chapter 5, translated from German)
String functions – codepoint conversion
A Boolean value xs:boolean; the value true if the arguments of the codepoints match, otherwise false.
A xs:string string whose codepoints shall be compared with the codepoints of a comparison string by means of the Unicode collation. The empty sequence is permitted as argument – in this case, the function returns an empty result sequence.
A xs:string string whose codepoints shall be compared with the codepoints of the string passed on as first argument. The empty sequence is permitted as argument – in this case, the function returns an empty result sequence.
Purpose of use:
The fn:codepoint-equal() function compares the Unicode codepoints of the characters of two character strings passed on to the function. It uses the Unicode codepoint collation which must be supported by each XPath implementation. The function returns the Boolean value true if both arguments have been passed on and the codepoints of all string characters match in pairs, in other words the input strings equal each other. In all other cases, false is returned.
If the empty sequence is passed on to one or both arguments, the function returns an empty result sequence. (Thus, in this case no Boolean value is outputted!)
Example 1 - comparison of two identical strings:
fn:codepoint-equal( 'My example string',
'My example string'
results in the value true.
Example 2 - comparison of two different strings:
fn:codepoint-equal( 'What must be, must be!',
'What must be, has to be!'
results in the value false.
Example 3 - passing on the empty sequence:
fn:codepoint-equal( 'It does not matter any more...',
Instead of a second argument, the empty sequence is passed on. As a consequence, the function returns an empty result sequence.
The function is not available.
fn:codepoint-equal($comparand1 as xs:string?,
$comparand2 as xs:string?) as xs:boolean?
|<< back||next >>|
Copyright © Galileo Press, Bonn 2008
Printing of the online version is permitted exclusively for private use. Otherwise this chapter from the book "XSLT 2.0 & XPath 2.0" is subject to the same provisions as those applicable for the hardcover edition: The work including all its components is protected by copyright. All rights reserved, including reproduction, translation, microfilming as well as storage and processing in electronic systems.
Galileo Press, Rheinwerkallee 4, 53227 Bonn, Germany