xsl 中 xsl:copy 的使用

<?xml version="1.0" encoding="gb2312"?>
<?xml-stylesheet type="text/xsl" href="copy.xsl"?>

<产品系列>
     
<产品>
      
<型号>mag xj570</型号>
        
<显像管 水平="0.24mm" 垂直="0.12mm" 尺寸="15">0.28极细至点</显像管>  
     
<控制>视控 onview 视 view Math </控制>
     
<分辨率>1280*1024</分辨率>
     
<符合标准>MPRII 标准</符合标准>
      
<价格>1399</价格>
       
<降价>200元</降价>
      
</产品>
       
<产品>
      
<型号>mag xj570</型号>
        
<显像管 水平="0.24mm" 垂直="0.12mm" 尺寸="15">0.28极细至点</显像管>  
     
<控制>视控 onview 视 view Math </控制>
     
<分辨率>1280*1024</分辨率>
     
<符合标准>MPRII 标准</符合标准>
      
<价格>13990</价格>
       
<降价>2000元</降价>
      
</产品>
    
</产品系列>


xsl
<?xml version="1.0" encoding="gb2312"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template math="/">
<html>
<head>
<title>使用 xsl:copy 元素示例</title>
</head>

<body>
<table border="1">
<xsl:for-each select="产品系列/产品">
<tr>
<xsl:apply-templates/>
</tr>
</xsl:for-each>
</table>
</body>
</html>

</xsl:template>

<xsl:template match="*">
<td>
<xsl:copy>
<xsl:value-of/>
</xsl:copy>
</td>
</xsl:template>
</xsl:stylesheet>

posted on 2005-04-27 09:13  gwazy  阅读(715)  评论(0编辑  收藏  举报

导航