Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
MarkLogic结构查询搜索_Marklogic_Marklogic 8 - Fatal编程技术网

MarkLogic结构查询搜索

MarkLogic结构查询搜索,marklogic,marklogic-8,Marklogic,Marklogic 8,我有下面的xml <prop:properties xmlns:prop="http://marklogic.com/xdmp/property"> <cpf:processing-status xmlns:cpf="http://marklogic.com/cpf">done</cpf:processing-status> <cpf:property-hash xmlns:cpf="http://marklogic.com/cpf">6b

我有下面的xml

<prop:properties xmlns:prop="http://marklogic.com/xdmp/property">
  <cpf:processing-status xmlns:cpf="http://marklogic.com/cpf">done</cpf:processing-status>
  <cpf:property-hash xmlns:cpf="http://marklogic.com/cpf">6b9dab35ed148cd08bba59503892a0fd</cpf:property-hash>
  <cpf:last-updated xmlns:cpf="http://marklogic.com/cpf">2017-05-23T17:56:54.5734822+05:30</cpf:last-updated>
  <cpf:state xmlns:cpf="http://marklogic.com/cpf">http://marklogic.com/states/converted</cpf:state>
  <lnk:link from="/mycompany/mlabcNew_doc.xhtml" to="/mycompany/mlabcNew.doc" rel="source" rev="conversion" strength="strong" xmlns:lnk="http://marklogic.com/cpf/links"/>
  <cpf:self xmlns:cpf="http://marklogic.com/cpf">/mycompany/mlabcNew.doc</cpf:self>
</prop:properties>

我没找到办法得到这个。请帮助

根据您的示例,名为“to”的属性的命名空间不是cpf/links命名空间

尝试:

注意:在对此类问题进行故障排除时,我通常使用xPath在查询控制台中确认元素和属性名称以及名称空间。这将删除许多层,并在某些情况下使故障排除更加简单

StructuredQueryBuilder qb = queryMgr.newStructuredQueryBuilder();

    StructuredQueryDefinition query = qb.properties(
                qb.word(qb.elementAttribute(
                            qb.element(new QName("http://marklogic.com/cpf/links", "link")), 
                            qb.attribute(new QName("http://marklogic.com/cpf/links", "to"))), 
                        "/mycompany/mlabcNew_doc.xhtml"));
StructuredQueryBuilder qb = queryMgr.newStructuredQueryBuilder();

    StructuredQueryDefinition query = qb.properties(
                qb.word(qb.elementAttribute(
                            qb.element(new QName("http://marklogic.com/cpf/links", "link")), 
                            qb.attribute(new QName("", "to"))), 
                        "/mycompany/mlabcNew_doc.xhtml"));