Name
[2.0] lower-case()
Given a string, returns the lowercased version of that string.
Syntax
xs:stringlower-case(xs:string)
Inputs
An xs:string
value.
Outputs
An xs:string in which all
of the uppercase letters in the original string have been
converted to lowercase. Any character that was originally in
lowercase and any character that does not have an lowercase value
is returned as is. If the value of the argument is the empty
sequence, a zero-length string is returned.
Accented characters and other features of the world’s
languages mean that changing the case of a string might change its
length. Also be aware that lower-case() and upper-case() are not always the
inverse of each other in some languages. All of the case
conversion rules are defined by the Unicode standard, and XSLT
processors are expected to conform with those rules.
Defined in
XQuery 1.0 and XPath 2.0 Functions and Operators section 7.4, “Functions on String Values.”
Example
Here is a stylesheet that illustrates the lower-case() function. Notice that
we’re using <xsl:output method="xml"
encoding="UTF-8"/> to make sure the character set is
handled properly:
<?xml version="1.0" encoding="UTF-8"?> <!-- lower-case.xsl --> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" encoding="UTF-8" indent="yes"/> <xsl:template match="/"> <testcase> <heading>Tests of the lower-case() function:</heading> <test> <label>lower-case('Lily') = </label> <result><xsl:value-of select="lower-case('Lily')"/></result> ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access