xml方面的的问题,请高手指教

02-12-03 nmg

大家好:
我遇到一个问题,诚恳的向各位朋友请教。
  在xsl中如何得到xml中的值
  <a href="../../jsp/user/editUsers.jsp?userId=此处应该如何写" target="right">修改</a>
  userId应得到listUsers.xml文件中userId element的值
  不知如何才能得到:(环境:win2000,tomcat3.2,IE6.0)
  
  xml文件如下:
  文件名:listUsers.xml
 <?xml version="1.0" encoding="GB2312"?> 
<?xml-stylesheet type="text/xsl" href="listUsers.xsl"?> 
 <Data> 
  <anRecord> 
    <userId>1</userId>
    <userName>userName1</userName> 
    <password>password1</password> 
  </anRecord> 
  <anRecord> 
    <userId>2</userId>
    <userName>userName2</userName> 
    <password>password2</password> 
  </anRecord> 
  <anRecord> 
    <userId>3</userId>
    <userName>userName3</userName> 
    <password>password3</password> 
  </anRecord> 
  </Data> 
  
  xsl文件如下:
  文件名:listUsers.xsl
  <?xml version="1.0" encoding="GB2312"?> 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
 
 <xsl:template match ="/">
 
 <html> 
  <head>
 <META content="text/html; charset=gb2312" http-equiv="Content-Type"/>
 <LINK href="../jsp/css/css1.css" rel="stylesheet" type="text/css"/>
 </head>
 <body bgColor="lavender">
 <form action="../../servlet/myself.generatejavacode.user.UsersServlet"
id="form1" method="post" name="form1">
 <table border="1" bordercolordark="#ffffff" bordercolorlight="#666666" cellpadding="0" cellspacing="0" width="460" align="center">
      <tr bgcolor="#666699">
      <td width ="30%" class="word2">
          <div align="center">userId</div>
      </td>
      <td width ="30%" class="word2">
        <div align="center">userName</div>
      </td>
      <td width ="30%" class="word2">
        <div align="center">password</div>
      </td>
      </tr>

      <xsl:for-each select="Data/anRecord">
      
      
      <tr bgcolor="white">
      <td width="150" height="6"></td>
      <td width="150"></td>
      <td width="150"></td>
      </tr>
      <tr>
        <td width="150" bgcolor="#FFFFFF">
          <input type="checkbox" name="checkbox">
    		<xsl:attribute name="value"><xsl:value-of select="userId" />
   		</xsl:attribute>
	  </input>


          <xsl:value-of select="userId" />
        </td>
        <td width="150" bgcolor="#FFFFFF"><xsl:value-of select="userName" /></td>
        <td width="150" bgcolor="#FFFFFF"><xsl:value-of select="password" />
        
        <xsl:attribute name="id">
        <xsl:value-of select="userId" />
   		</xsl:attribute>
        <a href="../../jsp/user/editUsers.jsp?userId=此处应该如何写" target="right">修改</a>
        </td>
      </tr>
      </xsl:for-each>

    </table>
    <input id="submit" name="submit" style="HEIGHT: 35px; WIDTH: 80px" type="submit" value="delete"></input>
    </form>
  </body>
  </html>
</xsl:template>
</xsl:stylesheet>

<p>