End Function
'检查表单是否成功提交,如提交,更新 XML 文件;否则,转到编辑状态。
If Request.Form("btnSubmit") = "" Then
LoadXMLFile Server.MapPath("UserData.xml"),Server.MapPath("UserData.xsl")
Else
UpdateXML Server.MapPath("UserData.xml")
End If
%>
当表单提交成功后,我们用UpdatedUserData.xsl来显示我们刚刚编辑的数据。
UpdatedUserData.xsl如下:
<?xml version="1.0" encoding="gb2312"?>
<!-- edited with XMLSPY v2004 rel. 4 U (http://www.xmlspy.com) by Dicky (Apple'S Eden) -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
<body>
<h1>Updated UserInfo:</h1>
<table border="1" cellpadding="2">
<xsl:for-each select="UserInfo/Field">
<tr>
<td>
<xsl:value-of select="@ID"/>
</td>
<td>
<xsl:value-of select="FieldValue"/>
</td>
</tr>
</xsl:for-each>
</table>
<form>
<input type="button" value="Go Back" />
</form>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
以上只是XML跨平台应用的一个简单的例子,结合具体的需求,我们可以编写功能更强大的程序来完成我们更负杂的工作。所有程序在Windows 2003 En+IIS 6.0+IE6.0+MSXML3.Dll环境下调试通过。

















