This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: HTML tag inside <xsl:when></xsl:when> tag
- From: Matts Isuls <matts dot isuls at AGROLINK dot FI>
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Date: Thu, 21 Feb 2002 09:31:25 +0200
- Subject: Re: [xsl] HTML tag inside <xsl:when></xsl:when> tag
- Reply-to: xsl-list at lists dot mulberrytech dot com
I'm quite new att this and did not get that:
"What you have to keep in mind is that you are writing well-formed xml, even
if you will produce html at the end. When you put a start tag within
another element, in this case xsl:when, the close tag for that element has
to be nested properly within that element as well."
And i did not explain my problem properly, but here is the solution that
produces what i expected. Put together for your posts:
<td>
<xsl:attribute name="align">
<xsl:choose>
<xsl:when test="ss:Data/@ss:Type = 'Number'">right</xsl:when>
<xsl:otherwise>left</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:value-of select="ss:Data"/>
</td>
Before i had it in my mind before that this (see below) was OK (wellformed
and all that). Still learning every day.
<xsl:choose>
<xsl:when test="ss:Data/@ss:Type = 'Number'">
<td align="right">
</xsl:when>
<xsl:otherwise>
<td align="left">
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="ss:Data"/>
</td>
thanks all
Matts Isuls
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list