我想從下面XML匹配屬性(磅= prodbind和s = FALSE):如何寫一個XPath/XSLT查詢匹配兩個屬性
< testResults version="1.2">
< sample na="2" ng="2" by="346" dt="text" tn="Thread Group 1-2" rm="javax.naming.CommunicationException: defaulthost:30 [Root exception is java.net.UnknownHostException: defaulthost]" rc="800" lb="ProdBind" s="false" ts="1468674969351" lt="0" t="2123"/>
嘗試這些選項,但沒有運氣:
< xsl:variable name="prod1fail" select="count(/testResults/*[@lb = 'prodBind' and @s='false'])"/>
< xsl:variable name="prod1fail" select="count(//testResults/sample[@lb = 'prodBind' and @s='false'])"/>
感謝您的指點。
「*沒有運氣*」是沒有問題的一個很好的說明。 –