最近在搞extjs,使用的版本是2.2,服务器端采用asp,方便省事。asp好久没摸了,以前关于这块的内容不知道放哪去了,反正是在电脑里,巴拉老半天也找不到,所以还是重新搞一搞吧,搞了老半天才搞出个模样,还是记录一下吧,免得又忘了。
asp:
Response.CharSet = "utf-8" Set xmlhttp = Server.CreateObject("Microsoft.XMLHTTP") xmlhttp.Open "GET","http://localhost/ext2.2/my/form1.asp",False '动态生成的xml xmlhttp.Send Set xml = Server.CreateObject("Msxml2.DOMDocument") xml.async = false 'xml.load(Server.Mappath("2.xml")) ’可以使用本地的xml,如果想使用远程的xml必须用上面的xmlhttp方式获取 xml.loadxml(xmlhttp.responseText) Set xsl = Server.CreateObject("Msxml.DOMDocument") xsl.async = false xsl.load(Server.Mappath("1.xsl")) Response.Write xml.transformNode(xsl) Set xmlhttp = Nothing Set xml = Nothing Set xsl = Nothing
javascript:
var xml = new ActiveXObject("MSXML.DOMDocument"); xml.async = false; xml.load("http://localhost/ext2.2/my/form1.asp"); var xsl = new ActiveXObject("MSXML.DOMDocument"); xsl.async = false; xsl.load("http://localhost/ext2.2/my/1.xsl"); alert(xml.transformNode(xsl));
最新评论