在使用 xslt 转换 xml 时,我得到了结果,就像贾斯汀一样,有人可以解释下面标记为粗体的语句吗?
xsl:value-of select=" //*[price='8.20']/@supplier "
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Edited by XMLSpy® -->
<catalog>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
<cd supplier="justin">
<title>Unchain my heart</title>
<artist>Joe Cocker</artist>
<country>USA</country>
<company>EMI</company>
<price>8.20</price>
<year>1987</year>
</cd>
</catalog>
xslt:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Edited by XMLSpy® -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>My Supplier</h2>
<table border="1">
<xsl:value-of select="//*[price='8.20']/@supplier"/
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>