Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Nesting forces repeated code? >Thread Next - Re: Nesting forces repeated code? Re: Nesting forces repeated code?To: NULL Date: 9/6/2006 5:33:00 PM
Colin wrote:
> <tr>
> <xsl:choose>
> <xsl:when test="NAME='smith'">
> <td valign='top' bgcolor='#D0E0E0'>
> <i><xsl:value-of select="NAME"/>:</i>
> </td>
> </xsl:when>
> <xsl:otherwise>
> <td valign='top'>
> <i><xsl:value-of select="NAME"/>:</i>
> </td>
> </xsl:otherwise>
> </xsl:choose>
> </tr>
This
<tr>
<td valign="top">
<xsl:if test="NAME = 'smith'">
<xsl:attribute name="bgcolor">#D0E0E0</xsl:attribute>
</xsl:if>
<i><xsl:value-of select="NAME"/>:</i>
</td>
</tr>
should be easier. You simply need to make sure that you add any
attributes to the element (e.g. the td element) before you add content
to the element.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
