以下是XMl文件-
<Chapters>
<Chapter n="1">
<Desc>....</Desc>
<References>
<BookRef>HTML : in 21 Days</BookRef>
<Page>12, 13</Page>
<BookRef>HTML : Unlimited</BookRef>
<Page>21, 22</Page>
<BookRef>The Complete Reference - HTML</BookRef>
<Page>32-35</Page>
</References>
</Chapter>
<Chapter n="2">
<Desc>....</Desc>
<References>
<BookRef>HTML : in 21 Days</BookRef>
<Page>52, 53</Page>
<BookRef>The Complete Reference - HTML</BookRef>
<Page>132-145</Page>
<BookRef>The Complete Reference - Javascript</BookRef>
<Page>132-145</Page>
</References>
</Chapter>
</Chapters>
我正在尝试列出
-所有包含
HTML
的单词使用/Chapters/Chapter/References[BookRef contains text 'HTML']/BookRef
但是所有的都在显示...!检索相同内容的XQuery将是什么?
最佳答案
你要:
/Chapters/Chapter/References/BookRef[contains(., 'HTML')]