A
Alan
Hi,
Although an experienced programmer I am totally newto XML/XSL and in good
old style I'm trying to pick it up from various examples. I found one nice
e.g. that produced a basic table from a recordset produced XML document,
However what I would like to do is have each alternate line in the table
have a different colour the <TR> part of the XSL is
<xsl:template match="z:row">
<TR>
<xsl:for-each
select="/xml/s:Schema/s:ElementType[@name='row']/s:AttributeType">
<xsl:choose>
<xsl:when test="@rs:hidden" />
<xsl:when test="/xml/layout/field[@name $ieq$
context(-1)/@name]/@visible[text() $ieq$ 'false']"/>
<xsltherwise>
<td nowrap='true'>
<xsl:choose>
<xsl:when test="s:datatype/@dt:type[text() = 'string']"/>
<xsltherwise>
<xsl:attribute name="align">right</xsl:attribute>
</xsltherwise>
</xsl:choose>
<xsl:apply-templates
select="context(-2)/@*[nodeName()=context(-1)/@name]" />
</td>
</xsltherwise>
</xsl:choose>
</xsl:for-each>
</TR>
</xsl:template>
Is there a way to work out if the row is odd or even and then apply a class
to the row based on the result.
Thanks
Although an experienced programmer I am totally newto XML/XSL and in good
old style I'm trying to pick it up from various examples. I found one nice
e.g. that produced a basic table from a recordset produced XML document,
However what I would like to do is have each alternate line in the table
have a different colour the <TR> part of the XSL is
<xsl:template match="z:row">
<TR>
<xsl:for-each
select="/xml/s:Schema/s:ElementType[@name='row']/s:AttributeType">
<xsl:choose>
<xsl:when test="@rs:hidden" />
<xsl:when test="/xml/layout/field[@name $ieq$
context(-1)/@name]/@visible[text() $ieq$ 'false']"/>
<xsltherwise>
<td nowrap='true'>
<xsl:choose>
<xsl:when test="s:datatype/@dt:type[text() = 'string']"/>
<xsltherwise>
<xsl:attribute name="align">right</xsl:attribute>
</xsltherwise>
</xsl:choose>
<xsl:apply-templates
select="context(-2)/@*[nodeName()=context(-1)/@name]" />
</td>
</xsltherwise>
</xsl:choose>
</xsl:for-each>
</TR>
</xsl:template>
Is there a way to work out if the row is odd or even and then apply a class
to the row based on the result.
Thanks