This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Problem in making choices using <xsl:choose>
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] Problem in making choices using <xsl:choose>
- From: "Sreekanth Pallavoor" <sreekanth at tibco dot com>
- Date: Mon, 04 Jun 2001 20:07:06 -0700
- References: <002d01c0ea89$ef14f0c0$d7433c3e@PCUKMKA>
- Reply-To: xsl-list at lists dot mulberrytech dot com
This problem was due to a wrong setting in one of the inputs to the stylesheet.
The <xsl:choose> in stylesheet is in fact working fine.
Thanks.
-- Sreekanth
Michael Kay wrote:
> Weird. Can you show us a complete stylesheet that demonstrates the problem,
> and tell us which processor you're using?
>
> Mike Kay
> Software AG
>
> > -----Original Message-----
> > From: owner-xsl-list@lists.mulberrytech.com
> > [mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Sreekanth
> > Pallavoor
> > Sent: 01 June 2001 03:37
> > To: XSL-List@lists.mulberrytech.com
> > Subject: [xsl] Problem in making choices using <xsl:choose>
> >
> >
> > Hi,
> >
> > I am new to XSLT. I am writing one XSLT program, where I need to print
> > different output depending upon different conditions. But the
> > code which
> > checks for different conditions, doesn't seem to be working properly.
> > The relevant part of code is given below. Here I have got a variable
> > "state" getting set to some state code which comes from some external
> > source. If it's value is AZ, I want to print "Arizona" and if
> > it's value
> > is anything else then I want to print "Other". The result I am getting
> > is, it always prints "Arizona" even if $state is set to
> > something other
> > than "AZ". (To double-check, I am printing the $state value
> > also in the
> > output. Even if it is CA, the output I still get is "CA
> > Arizona" and not
> > "CA Other").
> >
> > Can someone tell me what could be the reason.
> >
> > Thanks.
> > -- Sreekanth
> >
> > <xsl:template match="headline">
> > <xsl:choose>
> > <xsl:when test="contains($state,'AZ')">
> > <font face="{$headline-font}"
> > size="{$headline-size}"><xsl:value-of select="$state"/>
> > Arizona </font>
> > </xsl:when>
> > <xsl:otherwise>
> > <font face="{$headline-font}"
> > size="{$headline-size}"><xsl:value-of select="$state"/> Other </font>
> > </xsl:otherwise>
> > </xsl:choose>
> > </xsl:template>
> >
> >
> > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
> >
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list