例如,有一个xml:
<article-list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="3.xsd">
<article section="physics">
Increasing linear dynamic range of commercial digital photocamera
<author>M. V. Konnik</author>
<content>
Methods of increasing linear optical dynamic range
</content>
</article>
我的目标是查询article
元素的字符串内容。IE:
Increasing linear dynamic range of commercial digital photocamera
像这样的明显解决方案:
<!--xquery-->
{
for $article in doc("name.xml")//article-list/article
where $article/receiving-date > xs:date("2005-01-01")
return
<article>
{$article}
</article>
}
返回整个article
树,而不仅仅是一个字符串。