Xalan 1.8 on WinXP

What I am really trying to do is produce an HTML table, where I can
dynamically set the foreground colour of the text.
The XML has an element that indicates whether the foreground should be
highlighted or not.

        <xsl:variable name="tr_nohi"   select="'&lt;tr&gt;'" />
        <xsl:variable name="tr_hi"     select="'&lt;tr&gt;'" />
        <xsl:variable name="tr_nohi_c" select="'&lt;/tr&gt;'" />
        <xsl:variable name="tr_hi_c"   select="'&lt;/tr&gt;'" />
            <xsl:choose>
              <xsl:when test="scores/scores.low_net_score = 1">
                  <xsl:value-of select="$tr_hi" />
              </xsl:when>
              <xsl:otherwise>
                  <xsl:value-of select="$tr_nohi" />
              </xsl:otherwise>
            </xsl:choose>

So I was thinking of dynamically changing the class attribute on the <tr>
tag to achieve this.  I am not sure if that will work yet, but I have run
into some issues producing my output.

This is what I have so far, but the output it generates looks like this:
&lt;tr&gt;<td align="center">

I tried something simplier originally:
            <xsl:choose>
              <xsl:when test="scores/scores.low_net_score = 1">
                  <tr>
              </xsl:when>
              <xsl:otherwise>
                  <tr>
              </xsl:otherwise>
            </xsl:choose>

But I get errors on this approach:
xalan_transform: Error: ret = -2 - SAXParseException: Expected end of tag
'tr' (http://localhost, line 85, column 25) - <xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";> 

Which is why I tried to dynamically create the tag.

Does anyone know why the &lt; and &gt; symbols are not expanded?

Does anyone have a better approach to the problem?

TIA,
Dave

Reply via email to