|
楼主 |
发表于 2020-5-22 09:15:01
|
显示全部楼层
我把xsl再贴出来给大家看看吧:
<?xml version="1.0" encoding="gb2312"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
....
<xsl:for-each select = "./Prod_Code/Year">
<xsl:if test="text()='2015'">
<tr bgcolor="silver">
<xsl:for-each select="./Y_M/Qty">
<td width = "80px" align = "left" valign
="top" style="font-size:9pt;">
<xsl:value-of />
</td>
</xsl:for-each>
</tr>
</xsl:if>
<xsl:if test="text()='2016'">
<tr>
<xsl:for-each select="./Y_M/Qty">
<td width = "80px" align = "left" valign
="top">
<input type= "text" id="M01" size = "10"
value = "" font-size="9pt"/>
</td>
</xsl:for-each>
</tr>
</xsl:if>
</xsl:for-each>
...
</xsl:template>
</xsl:stylesheet>
要格式化的xml部分代码如下:
<?xml version="1.0" encoding="gb2312" standalone="no"?>
<InputTable>
<Prod_CDesc>产品1
<Prod_Code>000-000-001
<Year>2015
<Y_M>2015-01
<Qty>10.00</Qty>
</Y_M>
........
</Year>
<Year>2016
<Y_M>2016-01
<Qty />
</Y_M>
................
</Year>
</Prod_Code>
</Prod_CDesc>
......
</InputTable>
请大家再帮忙看看,问题出在哪里? |
|