This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Q on xsl:choose
- To: xsl-list at lists dot mulberrytech dot com
- Subject: RE: [xsl] Q on xsl:choose
- From: sara dot mitchell at ps dot ge dot com
- Date: Wed, 21 Feb 2001 13:35:17 -0500
- Reply-To: xsl-list at lists dot mulberrytech dot com
Sorry :(, but the error message is correct.
The element xsl:when does not have a 'match' attribute
it has a 'test' attribute. Your code should be :
<xsl:choose>
<xsl:when test="@order='D'">DN</xsl:when>
<xsl:otherwise>UP</xsl:otherwise>
</xsl:choose>
Sara
> -----Original Message-----
> From: Walter Torres [mailto:walter@torres.ws]
> Sent: Tuesday, February 20, 2001 5:55 PM
> To: xsl-list@lists.mulberrytech.com
> Subject: [xsl] Q on xsl:choose
>
>
> I seem to be stuck!
>
> I have a small sample data set and am trying to use
> xsl:choose and xsl:when.
>
> (My code and data is below)
>
> I get this error message...
>
> Attribute 'match' is invalid on 'xsl:when'
>
> I have spent the last 2 days trying to see the error here.
>
> Can anyone elighten me?
>
> Thanks
>
> Walter
>
> PS: This is an extention to an example in Mr Kay's book.
>
>
> This is my data...
>
> <books>
> <titles>
> <display colWidth='040' id='item' order='D'>Item</display>
> </titles>
> </books>
>
> This is my code
>
> <xsl:template match='display'>
> <th valign='top'>
> <!-- define Default Sort Direction -->
> <xsl:attribute name='ind'>
> <xsl:choose>
> <xsl:when match="@order='D'">DN</xsl:when>
> <xsl:otherwise>UP</xsl:otherwise>
> </xsl:choose>
> </xsl:attribute>
> <!-- Display Title -->
> <xsl:value-of select='.'/>
> </th>
> </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