June 2008
Intermediate to advanced
986 pages
27h 8m
English
[2.0] codepoint-equal()
Determines whether two strings are equal, based on their Unicode codepoints.
xs:boolean?codepoint-equal(xs:string?,xs:string?)
Two xs:strings to be
compared.
This function returns true or false depending on whether the two
strings are equal using the Unicode code point collation. This
function allows you to compare xs:anyURI values without having to
specify a collation. If either argument is the empty sequence, the
result is the empty sequence.
XQuery 1.0 and XPath 2.0 Functions and Operators section 7.3, “Equality and Comparison of Strings.”
Here is a short stylesheet that tests strings to see whether they are equal:
<?xml version="1.0"?> <!-- codepoint-equal.xsl --> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xsl:output method="text"/> <xsl:template match="/"> <xsl:text>
Tests of the codepoint-equal() function:
</xsl:text> <xsl:text>
 codepoint-equal('A', 'A') = </xsl:text> <xsl:value-of select="codepoint-equal('A', 'A')"/> <xsl:text>
 codepoint-equal('A', '&#x41;') = </xsl:text> <xsl:value-of select="codepoint-equal('A', 'A')"/> <xsl:text>
 codepoint-equal('A', '&#65;') = </xsl:text> <xsl:value-of select="codepoint-equal('A', 'A')"/> <xsl:text>
 codepoint-equal('Strasse', 'Stra&#xDF;e') = </xsl:text> <xsl:value-of select="codepoint-equal('Strasse', 'Straße')"/> </xsl:template> </xsl:stylesheet> ...
Read now
Unlock full access