这是XML文件
<?xml version="1.0" encoding="GB2312" standalone="no" ?>
<?xml-stylesheet href="hxh.xsl" type="text/xsl" ?>
<HxHBookShop>
<WebSite>http://www.ezhi.cn</WebSite>
<BookStore>
<Book>
<BookName No="F01001">哈哈哈</BookName>
<Price> 560 </Price>
<Authors>
<Author>贺星河</Author>
<Author>可以吗</Author>
</Authors>
<Intro> 贺星河是个大英雄</Intro>
<Picture>D:/Picture.jpg</Picture>
</Book>
</BookStore>
</HxHBookShop>
//这里是XSL样式表文件
<?xml version="1.0" encoding="GB2312" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"> //十二分注意不能把TR和WD写成小写了,否则浏览器不识别!
<xsl:template match="/">
<html>
<Body>
<xsl:for-each select="HxHBookShop">
<xsl:apply-templates/>
</xsl:for-each>
<Table border="1" cellpadding="5">
<Tr>
<th>书名</th>
<th>定价</th>
<th>作者</th>
<th>简介</th>
<th>图片</th>
</Tr>
<xsl:for-each select="//Book" order-by="+Price">
<tr>
<xsl:apply-templates/>
</tr>
</xsl:for-each>
</Table>
</Body>
</html>
</xsl:template>
<xsl:template match="//WebSite">
<font size = "5">
<a>
<xsl:attribute name="href">
<xsl:value-of/>
</xsl:attribute>
E旨网址
</a>
</font>
</xsl:template>
<xsl:template match="BookName">
<td width="100%" style="font-size:12px;color:#cc0000;">
<br/>
<font size = "5" color="black">书号</font>
</td>
</xsl:template>
<xsl:template match="Price">
<td style="color:red;"></td>
</xsl:template>
<xsl:template match="Authors">
<td style="color:blue;"></td>
</xsl:template>
<xsl:template match="Author">
<br/>
</xsl:template>
<xsl:template match="Intro">
<td width="220" style="font-size:10pt;">
</td>
</xsl:template>
<xsl:template match="Picture">
<td width="120" height="180">
<img width="120" height="180">
<xsl:attribute name="src">
<xsl:value-of/>
</xsl:attribute>
</img>
</td>
</xsl:template>
</xsl:stylesheet>