asfman
android developer
posts - 90,  comments - 213,  trackbacks - 0
xml:
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="cd.xsl"?> 
<catalog>
<CD>
<title>listener to mom</title>
<artist>asfman</artist>
<country>China</country>
<year>2007</year>
</CD>
</catalog>

xsl:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<html>
<head>
<style>
.tb{
border:1px solid red;
border-collapse:collapse;
}
.tb td,th{
line-height:25px;
border:1px solid red;
}
</style>
</head>
<body>
<table class="tb">
<tr>
<th>title</th>
<th>artist</th>
<th>country</th>
<th>year</th>
</tr>
<xsl:for-each select="catalog/CD">
<tr>
<td><xsl:value-of select="title" /></td>
<td><xsl:value-of select="artist" /></td>
<td><xsl:value-of select="country" /></td>
<td><xsl:value-of select="year" /></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

asp:
<%@ Language="Javascript" %>
<%
var xmlDom=Server.CreateObject("Microsoft.XMLDOM");
xmlDom.async=false;
xmlDom.load(Server.Mappath("cd.xml"));
var xslDom=Server.CreateObject("Microsoft.XMLDOM");
xslDom.async=false;
xslDom.load(Server.MapPath("cd.xsl"));
Response.Write(xmlDom.transformNode(xslDom));
%>
posted on 2007-09-30 16:08 汪杰 阅读(721) 评论(0)  编辑 收藏 引用 所属分类: xml
只有注册用户登录后才能发表评论。

<2024年4月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

常用链接

留言簿(15)

随笔分类(1)

随笔档案(90)

文章分类(727)

文章档案(712)

相册

收藏夹

http://blog.csdn.net/prodigynonsense

友情链接

最新随笔

搜索

  •  

积分与排名

  • 积分 - 457564
  • 排名 - 6

最新随笔

最新评论

阅读排行榜

评论排行榜