-- 作者:黑天使
-- 发布时间:5/9/2004 6:31:00 PM
-- 那位老兄帮忙看看为什莫无法显示(谢了)
要完成查询和添加,主页面是4-2.htm未写出,各程序之间无法链接,那位老兄给瞧瞧看问题出哪了,在下感激不尽。谢了。以下是源程序。 2-1.xsl <?xml version="1.0" encoding="gb2312"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"> <xsl:template match="/"> <html> <body> <center> <h2>手机资料</h2> <table border="7"> <col width="90"/> <col width="90"/> <col width="70"/> <col width="70"/> <col width="140"/> <thead> <th>手机号</th> <th>姓名</th> <th>年龄</th> <th>性别</th> <th>类型</th> </thead> <xsl:for-each select="students/student"> <tr> <td><xsl:value-of select="id"/></td> <td><xsl:value-of select="name"/></td> <td><xsl:value-of select="age"/></td> <td><xsl:value-of select="sex"/></td> <td><xsl:value-of select="class"/></td> </tr> </xsl:for-each> </table> </center> </body> </html> </xsl:template> </xsl:stylesheet> 1-1.xml ?xml version="1.0" encoding="gb2312"?> <?xml-stylesheet type="text/xsl" href="2-1.xsl"?> <students> <student> <id>13991253111</id> <name>张三</name> <age>23</age> <sex>男</sex> <class>校园卡</class> </student> <student> <id>13991253112</id> <name>张四</name> <age>23</age> <sex>男</sex> <class>校园卡</class> </student> <student> <id>13991253113</id> <name>张五</name> <age>23</age> <sex>男</sex> <class>校园卡</class> </student> <student> <id>13991253114</id> <name>张六</name> <age>23</age> <sex>男</sex> <class>校园卡</class> </student> <student> <id>13991253115</id> <name>张七</name> <age>23</age> <sex>男</sex> <class>校园卡</class> </student> </students> storage1.asp <body> <p align="center"> </p> <p align="left"> </p> <p align="left"> </p> <p align="center">  : : : <a href="1-1.xml"><font size="7" face="华文彩云">手机资料</font></a></p> <p align="center"><font face="华文彩云" size="5"><a href="4-2.htm"> 返回主菜单</a></font></p> <% set tempxml=server.createobject("msxml.domdocument") tempxml.load server.mappath("1-1.xml") set rnode=tempxml.Documentelement set elem=tempxml.createelement("student") elem.text=" " rnode.appendchild elem set rnodel=rnode.lastchild set elem1=tempxml.createelement("id") set elem2=tempxml.createelement("name") set elem3=tempxml.createelement("age") set elem4=tempxml.createelement("sex") set elem5=tempxml.createelement("class") elem1.text=request.form.item("T1") elem2.text=request.form.item("T2") elem3.text=request.form.item("T3") elem4.text=request.form.item("T4") elem5.text=request.form.item("T5") rnode1.appendchild elem1 rnode1.appendchild elem2 rnode1.appendchild elem3 rnode1.appendchild elem4 rnode1.appendchild elem5 tempxml.save server.mappath("1-1.xml") %> </body> 3-1.htm <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <title>New Page 1</title> </head> <body background="ricebk.jpg" bgcolor="#FFFFFF" text="#000000" link="#666633" vlink="#333366" alink="#990000"> <div align=center style="width: 754; height:433"> <xml id=xmlid src='[U]C:\Inetpub\Scripts\1-1.xml'></xml> <p> </p> <hl style="color:#8b0000">手机资料</hl> <hr align="center"> <p><span>手机号:</span> <input type=text datasrc=#xmlid datafld=id> <p><span>姓名:</span> <input type=text datasrc=#xmlid datafld="name"> <p><span>年龄:</span> <input type=text datasrc=#xmlid datafld="age"> <p><span>性别:</span> <input type=text datasrc=#xmlid datafld="sex"> <p><span>卡型:</span> <input type=text datasrc=#xmlid datafld="class"> <br><br> <input id="first" type=button value="第一个" onclick="xmlid.recordset.movefirst()"> <input id="prev" type=button value="上一个" onclick="if(!xmlid.recordset.bof) xmlid.recordset.moveprevious()"> <input id="next" type=button value="下一个" onclick="if(!xmlid.recordset.eof) xmlid.recordset.movenext()"> <input id="last" type=button value="最后一个" onclick="xmlid.recordset.movelast()"> <p align="center"><font color="#FF0066"><a href="3-11.htm"> 添加</a></font> <br><br> </form> <p><a href="file:///C:/Intepub/Scripts/1-1.xml">手机资料</a></p> </div> </body> </html> 3-11.htm <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <title>手机资料</title> </head> <body> <p align="center"> </p> <p align="center"><b><font size="6" color="#6666FF">手机资料 </font></b></p> <hr> <form method="POST" action="http://127.0.0.1/scripts/storage1.asp"> <p align="left"> : : : : : :  : : : : : : : : :  : : : : : : : : 手机号:<input type="text" name="T1" size="20"></p> <p align="left"> : : : : : :  : : : : : : : : :  : : : : : : : : 姓名:<input type="text" name="T2" size="20"></p> <p align="left"> : : : : : :  : : : : : : : : :  : : : : : : : : 年龄:<input type="text" name="T3" size="20"></p> <p align="left"> : : : : : :  : : : : : : : : :  : : : : : : : : 性别:<input type="text" name="T4" size="20"></p> <p align="left"> : : : : : :  : : : : : : : : :  : : : : : : : : 卡型:<input type="text" name="T5" size="20"></p> <p align="left"> </p> <p align="center"><input type="submit" value="提交" name="B1"> <input type="reset" value="重写" name="B2"></p> </form> </body> </html>
|