Marklogic - 使用get属性值的Xpath

Ant*_*ony 3 xpath marklogic

我在下面显示了示例Xml数据,如果title lang ="it"那么我想得到类别属性值?

<book category="CLASSICS">
  <title lang="it">Purgatorio</title>
  <author>Dante Alighieri</author>
  <year>1308</year>
  <price>30.00</price>
</book>
Run Code Online (Sandbox Code Playgroud)

har*_*r07 5

"如果title lang ="it"那时我想获得category属性值?"

XPath应该是直截了当的:

//book[title/@lang='it']/@category
Run Code Online (Sandbox Code Playgroud)