编写XSL以对xml数据执行某些操作

时间:2011-05-03 06:50:11

标签: html xml xslt

  

可能重复:
  wrirting XSL to perform some operations on xml data

如何在products.xsl的主体中编写xsl,这将获得产品名称和条件,其中产品数量> 10

products.xml -----------------

<?xml version="1.0" encoding="iso-8859-1"?>
<products>
<product>
<name>soaps</name>
<quantity>10</quantity>
<condition>ready</condition>
</product>
<product>
<name>soaps</name>
<quantity>15</quantity>
<condition>ready</condition>
</product>
<product>
<name>soaps</name>
<quantity>20</quantity>
<condition>ready</condition>
</product>
</products>

products.xsl -------

<?xml version="1.0"?><!-- DWXMLSource="products.xml" -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:template match="/">
<HTML>
<HEAD>
<TITLE> products</TITLE>
</HEAD>
<BODY>

products quantity greater than 10 : <BR/>


</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>

0 个答案:

没有答案