XML code
<?xml version="1.0" encoding="gb2312"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<title>结果</title>
</head>
<body>
<div align="center">
<p>冰激凌</p>
</div>
<div align="center">
<p>
<xsl:value-of select="*/name"/>
</p>
</div>
<xsl:apply-templates select="icecream_shop"/>
</body>
</html>
</xsl:template>
<xsl:template match="icecream_shop">
<p align="center">
<table border="1">
<tr>
<td>货号</td>
<td>品名</td>
<td>价格</td>
<td>描述页</td>
</tr>
<xsl:for-each select="icecream">
<tr>
<td>
<xsl:value-of select="货号"/>
</td>
<td>
<xsl:value-of select="品号"/>
</td>
<td>
<xsl:value-of select="价格"/>
</td>
<td>
<a>
<xsl:attribute name="href"><xsl:value-of select="描述页/@网址"/></xsl:attribute>
<xsl:value-of select="描述页"/>
</a>
</td>
</tr>
</xsl:for-each>
</table>
</p>
</xsl:template>
</xsl:stylesheet>