xml.xml:
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="xml.xsl"?>
<root>
<item>1</item>
<item>2</item>
<item>3</item>
</root>
xml.xsl:
<?xml version="1.0" encoding="GB2312"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:template match="/root">
<TABLE style="border: 1px solid black; width: 100px;">
<xsl:apply-templates/>
</TABLE>
</xsl:template>
<xsl:template match="item">
<TR>
<xsl:if test="position() mod 2=1">
<xsl:attribute name="style">background-color:yellow;</xsl:attribute>
</xsl:if>
<TD style="text-align: center; width: 100%;"><xsl:value-of select="text()"/></TD>
</TR>
</xsl:template>
</xsl:stylesheet>