求一个样式表文件,实现分行显示数据,帮忙up!
火电 2005-03-02 09:25:48 xml文件:
<DataSet>
<Column id="CHAJLY" desc="案件来源" >来自外地</Column>
<Column id="SARQ" desc="涉案时间" >2004-12-12</Column>
<Column id="CHSAAY" desc="涉案案由" >贪污罪</Column>
<Column id="CCRQ" desc="初查日期" >2004-12-12</Column>
<Column id="CHCCJG" desc="初查机关" >检察院</Column>
<Column id="YSLARQ" desc="以事立案日期" >2004-12-12</Column>
<Column id="QDXYRRQ" desc="确定嫌疑人日期" >2004-12-12</Column>
<Column id="LARQ" desc="立案日期" >2004-12-12</Column>
<Column id="QLASE" desc="全立案数额" >10000</Column>
<Column id="ZJRQ" desc="侦结日期" >2004-12-12</Column>
</DataSet>
我想按每行4列显示,包括两列字段描述和对应的值,共4个td
案件来源 来自外地 涉案时间 2004-12-12
涉案案由 贪污罪 初查日期 2004-12-12
就是类似上面的结构
我写了一个大致的xsl,但是不能满足
清帮忙修改或者重新提供一个
非常感谢!!!
<?xml version="1.0" encoding="gb2312"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes" doctype-public="-//W3C//DTD HTML 4.0 Transitional//EN"/>
<xsl:template match="/">
<html>
<body>
<table border="1" width="100%" align="center" style="BORDER-COLLAPSE: collapse" cellSpacing="0" cellPadding="2" rules="all">
<xsl:apply-templates/>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="Column">
<xsl:choose>
<xsl:when test="position() mod 3 = 0">
<tr>
<xsl:call-template name="LoopFun"/>
</tr>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="LoopFun"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="LoopFun">
<td align="center" width="25%" noWrap="true">
<label style="WIDTH:150px" bgcolor="#f6f6f6">
<xsl:value-of select="@desc"/>
</label>
</td>
<td bgcolor="#ffffff" width="25%">
<label style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 楷体_GB2312">
<xsl:value-of select="."/>
</label>
</td>
</xsl:template>
</xsl:stylesheet>