Antwort: case insensitivity

Hi Saqib,

how about trying this:

     <xsl:when test="lower-case(F2) = 'starting balance' ">
         <xsl:value-of select="F2"/>
     </fo:inline>

or 

     <xsl:when test="upper-case(F2) = 'STARTING BALANCE' ">
         <xsl:value-of select="F2"/>
     </fo:inline>


??

Or did you mean a test that the string contains only upper or lowercase 
letters ?

Than you could do somthing like:

             <xsl:variable name="F2String" 
select="java:java.lang.String.new()" />

     <xsl:when test="java:lang.String.matches($F2String, '"[A-Z]*"')"
         <xsl:value-of select="F2"/>
     </fo:inline>

In this case your stylesheet should contain something like:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"
    ...
    ...
    xmlns:java="http://xml.apache.org/xalan/java"
    exclude-result-prefixes="java">


so that you can use java from your stylesheet.

for further information on using java refer to 

http://www.cafeconleche.org/books/xmljava/chapters/ch17s03.html


Regards Olaf

www-xsl-fo-request@w3.org schrieb am 03.07.2008 06:52:02:

> Hello every one.
>  i want to use xsl:if for testing some string but discarding the 
> case sensitivity.
> the sample is 
>     <xsl:when test="F2 = 'Starting Balance' ">
>         <xsl:value-of select="F2"/>
>      </fo:inline>
> now i want to check it for lower case or upper case. I've already 
> gone through many codes but cannot understand its working. lower-
> case of xpath is also not working.
> Thanks
> Regards,
> Saqib javed

Received on Thursday, 3 July 2008 07:03:18 UTC