This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Basic xsl:choose question
- From: Antonio Fiol <fiol at w3ping dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Mon, 17 Jun 2002 11:15:49 +0200
- Subject: Re: [xsl] Basic xsl:choose question
- References: <000b01c21696$ff2c3d30$cd72003e@242cgyw7d7uhs3>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Meir wrote:
Hello list
again im trying to learn the concepts of xsl , with no much luck here ..
im trying to perform simple choose operation ,
i have this xsl ..
----------------------------------------------------------------------------
----------------------
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:for-each select="/CdList//*">
<xsl:call-template name="print"/>
</xsl:for-each>
</xsl:template>
<xsl:template name="print">
<xsl:choose>
<xsl:when test="name()[@type='father']">
<------------------------------------here is the problem
<span style="border:'1px solid red';width:auto">
<xsl:value-of select="name()"/><xsl:text>=</xsl:text>
<xsl:value-of select="./@id"/>
</span>
</xsl:when>
<xsl:otherwise>
<span style="border:'1px solid black';width:auto">
<xsl:value-of select="name()"/><xsl:text>=</xsl:text>
<xsl:value-of select="./@id"/>
</span>
</xsl:otherwise>
</xsl:choose>
<br/>
</xsl:template>
</xsl:stylesheet>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list