Hello,
I have some xml data that look like:
<currencysummar y rec_count="16">
<currency>
<currency_descr iption>$</_currency_descr iption>
<currency_code> 1</_currency_code>
</currency>
<currency>
<currency_descr iption>£</_currency_descr iption>
<currency_code> 2</_currency_code>
</currency>
<currency>
<currency_descr iption>€</_currency_descr iption>
<currency_code> 3</_currency_code>
</currency>
<currency>
<currency_descr iption>$</_currency_descr iption>
<currency_code> 4</_currency_code>
</currency>
</currencysummary >
I'd like to get it to look like:
<table cellpadding="2" cellspacing="0" border="0">
<tr><td>1$</td><td>2£</td></tr>
<tr><td>3€</td><td>4$</td></tr>
</table>
I've tried
<table cellpadding="2" cellspacing="0" border="0">
<xsl:for-each select="/page/contents/currencysummary/currency">
<xsl:choose>
<xsl:when test="((currenc y_code mod 2) = 0)">
<td><xsl:valu e-of
select="currenc y_code"></xsl:value-of><xsl:value-of
select="currenc y_description"> </xsl:value-of></td></tr>
</xsl:when>
<xsl:otherwis e>
<tr><td><xsl:va lue-of
select="currenc y_code"></xsl:value-of><xsl:value-of
select="currenc y_description"> </xsl:value-of></td>
</xsl:otherwise>
</tr>
</xsl:choose>
</xsl:for-each>
</table>
But the xml parser doesn't like it because I have incomplete <trtags.
I also tried doing a CDATA around the beginning and ending <trtags.
Does anyone know how to do this?
-Eric