+ -
当前位置:首页 → 问答吧 → 【求助】 一个xsl问题

【求助】 一个xsl问题

时间:2004-01-06

来源:互联网

具体看这里!
http://www.8qp8.com/osdn/temp/134.xml?temp=.81590254

作者: 忧郁之蓝   发布时间: 2004-01-06

test.xml:
====
<?xml version="1.0" ?>
<?xml:stylesheet type="text/xsl" href="test.xsl" ?>
<Root>
<SubRoot id="1" XMLSrc="1.xml"></SubRoot>
<SubRoot id="2" XMLSrc="2.xml"></SubRoot>
<SubRoot id="3" XMLSrc="3.xml"></SubRoot>
<SubRoot id="4" XMLSrc="4.xml"></SubRoot>
</Root>


test.xsl:
====
<?xml version="1.0" encoding="gb2312" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
  <html>
  <body>
    <table border="1" width="50">
      <tr bgcolor="#9acd32">
        <th align="center">ID</th>
      </tr>
      <xsl:for-each select="Root/SubRoot">
      <tr>
        <td align="center"><xsl:value-of select="@id"/></td>
      </tr>
      </xsl:for-each>
    </table>
  </body>
  </html>
</xsl:template>
</xsl:stylesheet>

作者: bencalie   发布时间: 2004-01-07

<xsl:template match="Root/SubRoot">
<tr><td align="center"><xsl:value-of select="@id" /></td></tr>
</xsl:template>



这样要快些……
在 MsXML 里面如此

作者: snakevil   发布时间: 2004-01-08