XML、XSL转换输出HTML
2008-10-12 15:28
357 查看
Javascript客户端转换
<html>
<body>
<script language="javascript">
// Load XML
var xml = new ActiveXObject("Microsoft.XMLDOM")
xml.async = false
xml.load("cd_catalog.xml")
// Load the XSL
var xsl = new ActiveXObject("Microsoft.XMLDOM")
xsl.async = false
xsl.load("cd_catalog.xsl")
// Transform
document.write(xml.transformNode(xsl))
</script>
</body>
</html>
Asp服务端转换
<%
'Load the XML
set xml = Server.CreateObject("Microsoft.XMLDOM")
xml.async = false
xml.load(Server.MapPath("cd_catalog.xml"))
'Load the XSL
set xsl = Server.CreateObject("Microsoft.XMLDOM")
xsl.async = false
xsl.load(Server.MapPath("cd_catalog.xsl"))
'Transform the file
Response.Write(xml.transformNode(xsl))
%>
<html>
<body>
<script language="javascript">
// Load XML
var xml = new ActiveXObject("Microsoft.XMLDOM")
xml.async = false
xml.load("cd_catalog.xml")
// Load the XSL
var xsl = new ActiveXObject("Microsoft.XMLDOM")
xsl.async = false
xsl.load("cd_catalog.xsl")
// Transform
document.write(xml.transformNode(xsl))
</script>
</body>
</html>
Asp服务端转换
<%
'Load the XML
set xml = Server.CreateObject("Microsoft.XMLDOM")
xml.async = false
xml.load(Server.MapPath("cd_catalog.xml"))
'Load the XSL
set xsl = Server.CreateObject("Microsoft.XMLDOM")
xsl.async = false
xsl.load(Server.MapPath("cd_catalog.xsl"))
'Transform the file
Response.Write(xml.transformNode(xsl))
%>
相关文章推荐
- XML联合XSL输出html report
- 将html代码保存到xml文件中并用xsl转换输出到网页中的方法
- 使用XSL将XML文档中的CDATA注释输出为HTML文本
- Page_Load中指给客户端输出一个字符串 而不是所有的html内容也输出 出去 ;输出之后会发现在客户端接收的时候 responseText有值 但是responseXML没值
- Python实现把xml或xsl转换为html格式
- FreeMarker 自动转义和格式化HTML和XML输出,预防xss
- XML+XSL输出HTML时,直接将XML输出为HTML的2种方法
- 使用XSL将XML文档中的CDATA注释输出为HTML文本
- Page_Load中指给客户端输出一个字符串 而不是所有的html内容也输出 出去 ;输出之后会发现在客户端接收的时候 responseText有值 但是responseXML没值
- jsp 将html字符串输出html标签(escapeXml)
- Python将xml和xsl转换为html的方法
- xml在html中输出
- 使用XSL将XML文档中的CDATA注释输出为HTML文本
- 用python把xml和xsl转换为html
- 输出word EXCEL xml html处理---H_print.php
- 将从数据库得到的信息分别以HTML,XML,Json的形式输出
- Python xml和xsl转换为html
- 直接用mysql输出xml或html语句
- JS操作XML,按照XSLT逻辑,输出到HTML
- Python将xml和xsl转换为html的方法