Re: How to access lower-case() function in XPath
sebb <[email protected]> Thu, 21 Jan 2010 16:43:21 +0000
| Newsgroups | gmane.text.xml.xalan.java.user |
|---|---|
| Message-ID | <[email protected]> |
On 21/01/2010, Mukul Gandhi <[email protected]> wrote: > On Thu, Jan 21, 2010 at 9:47 PM, sebb <[email protected]> wrote: > > Does Xalan 2.7.1 support the lower-case() function? > > > > If so, how does one enable support for it? > > > Xalan-J is an XSLT 1.0/XPath 1.0 processor, and these language > versions do not have a lower-function function. > > However, you could implement lower-case functionality in XSLT > 1.0/XPath 1.0 with "translate" function. > > Here's an example for a lower-case conversion: > translate($inputStr, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') > > If you are working in XSLT 1.0 environment, you may use XSLT > variables, for better modularity, for e.g, as below: > > <xsl:variable name="capsLetters" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" /> > <xsl:variable name="smallCaseLetters" select="'abcdefghijklmnopqrstuvwxyz'" /> > > translate($inputStr, $capsLetters, $smallCaseLetters) > OK, thanks very much for the quick response. That works for me. > -- > Regards, > > Mukul Gandhi >