给定以下XML:
<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>
<title>Greatest Hits</title>
<artist>Dolly Parton</artist>
<country>USA</country>
<company>RCA</company>
<price>9.90</price>
<year>1982</year>
</cd>
<cd>
<title>Still got the blues</title>
<artist>Gary Moore</artist>
<country>UK</country>
<company>Virgin records</company>
<price>10.20</price>
<year>1990</year>
</cd>
</catalog>
我想检查至少一个节点是否具有例如“1982年”的年份。类似于:
<xsl:if test="........" ><p>passed!</p></xsl:if>
test="catalog/cd/year[contains(.,'1982')]"
。 - Wojciech Owczarczykcontains()
不是你想要的--你想要测试相等性。 - Dimitre Novatchev