Java核心代码例程之:(JAXP) cart.xml
2008-01-05 08:40:10 来源:WEB开发网核心提示:<?xml version="1.0"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"><xsl:template m
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<Html>
<head>
<title>Shopping Cart</title>
</head>
<body>
<h1>Shopping Cart</h1>
<table border="1">
<tr>
<td><b>ID</b></td>
<td><b>Make</b></td>
<td><b>Model</b></td>
<td><b>PRice</b></td>
<td><b>Count</b></td>
</tr>
<xsl:for-each select="cart/item">
<tr>
<td><xsl:value-of select="id"/></td>
<td><xsl:value-of select="make"/></td>
<td><xsl:value-of select="model"/></td>
<td><xsl:value-of select="price"/></td>
<td><xsl:value-of select="count"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
更多精彩
赞助商链接