SQLXML系列之一:SQLXML初体验——用XML代替SQL来操作数据库
2008-12-06 10:16:03 来源:WEB开发网Transform/OrderDetail.xsl
<?xml version="1.0" encoding="utf-8"?>
5. 创建CSS
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="orders">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Order Management</title>
<link href="Order.css" rel="stylesheet" type="text/css" />
</head>
<body>
<xsl:apply-templates select="order"></xsl:apply-templates>
</body>
</html>
</xsl:template>
<xsl:template match="order">
<table cellpadding="0px" cellspacing="0px" >
<tr>
<td colspan="2" class="heading2">
Order No.:<xsl:value-of select="@id"/>
Date:<xsl:value-of select="@date"/>
Supplier:<xsl:value-of select="@supplier"/>
</td>
</tr>
<xsl:apply-templates select="product"></xsl:apply-templates>
</table>
</xsl:template>
<xsl:template match="product">
<tr>
<td colspan="2">
Product No.:<xsl:value-of select="@id"/>
</td>
</tr>
<tr>
<td width="10%">Name</td>
<td style="background-color:#ECF9EE">
<xsl:value-of select="@name"/>
</td>
</tr>
<tr >
<td >Price</td>
<td style="background-color:#ECF9EE">
<xsl:value-of select="@price"/>
</td>
</tr>
<tr >
<td >Quantity</td>
<td style="background-color:#ECF9EE">
<xsl:value-of select="@quantity"/>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>
更多精彩
赞助商链接