5
我必須從類似於下面的評級標籤中選擇評級代碼,但僅限代理機構爲'SP'或'SNP'時。現在我有:如何使用XPath選擇多個可能的文本值?
./ratings/rating/agency[text()='SNP'|text()='SP']/../code
雖然這似乎沒有工作。我究竟做錯了什麼?
<ratings>
<rating>
<agency>SP</agency>
<provider>SP</provider>
<type>LONG TERM</type>
<currencyType>LOCAL</currencyType>
<description>SP Standard LT LC rating</description>
<code>BBB+</code>
<date>2011-09-07</date>
</rating>
</ratings>
感謝,
賈裏德