Subject: RE: when and xsl:choose
From: "Foster, Justin (IT_Architecture)" <JFoster@xxxxxxxxxxx>
Date: Tue, 18 Jul 2000 15:40:30 -0700
|
Thanks for the suggestion. However, it works equally well with either
<xml:when match=> and <xml:when test=>
I'm new to this (obviously). Should it not work this way?
Justin Foster
IT Architecture
253-596-3260 office
253-223-3108 mobile
> ----------
> From: Albert, Kevin[SMTP:kjalbert@xxxxxxxxxxxxxxxxxxxxx]
> Reply To: xsl-list@xxxxxxxxxxxxxxxx
> Sent: Tuesday, July 18, 2000 2:15 PM
> To: 'xsl-list@xxxxxxxxxxxxxxxx'
> Subject: RE: when and xsl:choose
>
> What URI is your XSL namespace mapped to?
> The xslt spec contains a "test" attribute on the xsl:when element, not a
> "match" attribute.
> Try changing <xsl:when match=""> to <xsl:when test="">.
>
> Regards,
> Kevin Albert
>
> -----Original Message-----
> From: Foster, Justin (IT_Architecture) [mailto:JFoster@xxxxxxxxxxx]
> Sent: Tuesday, July 18, 2000 2:13 PM
> To: 'xsl-list@xxxxxxxxxxxxxxxx'
> Subject: xsl:when and xsl:choose
>
>
> OK,
>
> Accoding to my documentation, something like this should work (unless of
> course I am misinterpreting the documentation, which is highly likely.
> (Introduction to XML)
>
> <xsl:template match="/">
> <xsl:apply-templates/>
> </xsl:template>
>
> <xsl:template match="ELEMENT">
>
> <xsl:choose>
> <xsl:when match="[@initcost='0']">
> <img src="c:\windows\desktop\Stylesheet Files\bar-0-48.gif"
> width="48" height="150"/>
> </xsl:when>
>
> <xsl:when match="[@initcost='1']">
> <img src="c:\windows\desktop\Stylesheet Files\bar-green1.gif"
> width="48" height="150"/>
> </xsl:when>
>
> <xsl:when match="[@initcost='2']">
> <img src="c:\windows\desktop\Stylesheet Files\bar-green2.gif"
> width="48" height="150"/>
> </xsl:when>
>
> <xsl:when match="[@initcost='3']">
> <img src="c:\windows\desktop\Stylesheet Files\bar-green3.gif"
> width="48" height="150"/>
> </xsl:when>
>
> <xsl:otherwise>
> <img src="c:\windows\desktop\Stylesheet Files\bar-0-48.gif"
> width="48" height="150"/>
> </xsl:otherwise>
>
> </xsl:choose>
>
> </xsl:template>
>
> When I use this stylesheet, it always loads only the first image without
> even considering what the XML attribute values are. Here's an XML snippet
> that I'm referencing:
>
> <ELEMENT initcost="1" />
>
> Why is this?
>
>
>
> Justin Foster
> IT Architecture
> 253-596-3260 office
> 253-223-3108 mobile
>
>
> 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
| Current Thread |
- RE: when and xsl:choose, (continued)
- Albert, Kevin - Tue, 18 Jul 2000 17:15:23 -0400
- Spychalski, Frank - Tue, 18 Jul 2000 23:21:28 +0200
- RSuiter - Tue, 18 Jul 2000 17:15:57 -0500
- Foster, Justin (IT_Architecture) - Tue, 18 Jul 2000 15:40:30 -0700 <=
- Kay Michael - Thu, 20 Jul 2000 08:39:42 +0100
- Kay Michael - Thu, 20 Jul 2000 10:14:35 +0100
|
|