W3C home > Mailing lists > Public > www-xsl-fo@w3.org > July 2008

Re: case insensitivity

From: Saqi <saqib.javed@gmail.com>
Date: Thu, 3 Jul 2008 13:59:38 +0500
Message-ID: <e43b65bd0807030159i3bcab8cft60abd9b303c49c6c@mail.gmail.com>
To: www-xsl-fo@w3.org
Hello Olaf Wentzien

Yes i got the point. Actually i was missing the include. i.e
xmlns:fn"http://www.w3.org/2005/xpath-functions"
so as i added this the function has started to work.

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

Thanks
Regards,
Saqib Javed

On Thu, Jul 3, 2008 at 12:02 PM, Olaf Wentzien <olaf.wentzien@ppi.de> wrote:

>
> 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 09:00:19 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 3 July 2008 09:00:20 GMT