我无法理解 和 之间cts:search
的尊重cts:element-attribute-values
。我可以用这两个函数得到相同的结果。最好的解决办法是什么?
cts:search(/t:ancestors-list/t:concept/t:concept-ancestor, cts:element-value-query(xs:QName("t:concept-ancestor"), $concept/id))/@subject
或者
cts:element-attribute-values(
xs:QName("t:concept-ancestor"),
xs:QName("subject"),
(),
("collation=http://marklogic.com/collation/codepoint"),
cts:element-value-query(
xs:QName("t:concept-ancestor"),
$concept/id
)
)
ar:concept-ancestor是元素范围索引和元素属性范围索引。
和这样的xml结构
<t:ancestors-list xmlns:ar="http://test.com">
<t:concept subject="http://test.com/concept#1c5cd7082ac908c62e9176770ae0fb53">
<t:concept-ancestor subject="http://test.com/concept#1c5cd7082ac908c62e9176770ae0fb53">4a1f650290103d39863bf7bc22ef18aa</t:concept-ancestor>
</t:concept>
<t:concept subject="http://test.com/concept#05b707457f79f42c93bf778915e4a589">
<t:concept-ancestor subject="http://test.com/concept#05b707457f79f42c93bf778915e4a589">4a1f650290103d39863bf7bc22ef18aa</t:concept-ancestor>
<t:concept-ancestor subject="http://test.com/concept#05b707457f79f42c93bf778915e4a589">1c5cd7082ac908c62e9176770ae0fb53</t:concept-ancestor>
</t:concept>
...
</t:ancestors-list>
谢谢!