我正在尝试编写一个XQuery,它将返回italics()中所有单词的列表,用于xml,如:
<p>There is abundant evidence of a widened and deepened interest in <i>modern</i>
science. How could it be <i>otherwise</i> when we <i>think</i> of the magnitude and the
eventfulness of recent advances?</p>
谢谢!
答案 0 :(得分:0)
let $p :=
<p>There is abundant evidence of a widened and deepened interest in
<i>modern</i> science. How could it be <i>otherwise</i> when we <i>think</i> of the
magnitude and the eventfulness of recent advances?</p>
return $p/i
如果您将嵌套在元素中的斜体,则可以使用$p//i
搜索所有后代。如果您需要一系列字符串而不是<i>
元素,则可以使用:
for $i in $p/i
return string($i)
或者某些XQuery处理器将支持更简洁的$p/i/string()
。