【发布时间】:2018-09-05 06:23:06
【问题描述】:
我在 MarkLogic 中存储了以下 XML,
<testDoc>
<test>
<test1>test1</test1>
<test2>test2</test2>
<test3>test3</test3>
</test>
</testDoc>
我的要求是只获取子节点的 xpath,如果我通过 test(partial node name) 到我的 xquery,那么我期待
/testDoc/test/test1
/testDoc/test/test2
/testDoc/test/test3
但是我的 xquery 返回了,
/testDoc
/testDoc/test
/testDoc/test/test1
/testDoc/test/test2
/testDoc/test/test3
我在 qconsole 上执行的 XQuery 是,
xquery version "1.0-ml";
let $xml := document { fn:doc("/test/testDoc")}
let $elem-name := "test"
let $elems := $xml//*[local-name()[contains(lower-case(.), lower-case($elem-name))]]
return $elems ! xdmp:path(.)
请指导我实现我的要求。
【问题讨论】:
标签: marklogic marklogic-8