xml的资源文件 catalog.xml <?xml version="1.0" encoding="gb2312"?> bicyle loveChina,我爱你中国。 中国 Columbia 10.90 1982 bicyle loveChina,我爱你中国。 中国 Columbia 10.90 1982 catalog_html.xsl <?xml version='1.0'?> " target="_blank">http://www.w3.org/TR/WD-xsl">
catalog_wap.xsl <?xml version="1.0" encoding="gb2312"?> " target="_blank">http://www.w3.org/TR/WD-xsl">
index.asp liulanqi=request.ServerVariables("HTTP_User-Agent") if Instr(liulanqi,"Mozilla")<>0 then xls_use="catalog_html.xsl" else xls_use="catalog_wap.xsl" Response.ContentType = "text/vnd.wap.wml" response.Write("<?xml version='1.0' encoding='gb2312'?>") response.Write(">")" target="_blank">http://www.wapforum.org/DTD/wml_1.1.xml'>") end if 'Load the XML set xml = Server.CreateObject("Microsoft.XMLDOM") xml.async = false xml.load(Server.MapPath("catalog.xml")) 'Load the XSL set xsl = Server.CreateObject("Microsoft.XMLDOM") xsl.async = false xsl.load(Server.MapPath(xls_use)) 'Transform the file Response.Write(xml.transformNode(xsl)) %> 以上文件为以前学习xml后,学着编写的适合ie浏览器和手机、wap模拟器访问演示的程序代码,根据不同的设备生成两种代码。 希望大家提意见:以更好开发xml的多平台应用。 | ||||
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10294527/viewspace-125307/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/10294527/viewspace-125307/