English 中文(简体)
如何在Marklogic中建立要素范围指数?
原标题:How to create element range index in Marklogic?

页: 1

<?xml version="1.0" encoding="UTF-8"?>
<patent-assignment>
  <assignment-record>
    <correspondent>
      <name>NORTH AMERICA INTERNATIONAL PATENT OFFIC</name>
      <address-1>P.O. BOX 506</address-1>
      <address-2>MERRIFIELD, VA 22116</address-2>
    </correspondent>
   </assignment-record>
  <patent-assignors>
    <patent-assignor>
      <name>TSAI, YU-WEN</name>
      <execution-date>
    <date>20050331</date>
      </execution-date>
    </patent-assignor>
    <patent-assignor>
      <name>HUANG, CHENG-I</name>
      <execution-date>
    <date>20050331</date>
      </execution-date>
    </patent-assignor>
  </patent-assignors>
  <patent-assignees>
    <patent-assignee>
      <name>FARADAY TECHNOLOGY CORP.</name>
      <address-1>NO.10-2, LI-HSIN ROAD 1, SCIENCE-BASED INDUSTRIAL PARK</address-1>
      <city>HSIN-CHU CITY</city>
      <country-name>TAIWAN</country-name>
    </patent-assignee>
  </patent-assignees>
 </patent-assignment>

现在,我想在patent-Assignorpatent-Assignee上制定范围要素指数。 但是,在Marklogic中,没有选择为范围指数确定XPath。 它只是将指数名称作为“名称”。 因此,在patent-Assignorpatent-Assignee上设定要素范围指数的恰当方式是什么?

最佳回答

为了获得一组名字,马克·洛希奇需要能够区分几套。 您的最好之事是将姓名(目前为“名称”)或名词(目前为无)改为名词。 在这样做之后,你可以建立一个要素----指标,并使用:要素-价值。 例如:

<?xml version="1.0" encoding="UTF-8"?>
<patent-assignment>
  <assignment-record>
    <correspondent>
      <name>NORTH AMERICA INTERNATIONAL PATENT OFFIC</name>
      <address-1>P.O. BOX 506</address-1>
      <address-2>MERRIFIELD, VA 22116</address-2>
    </correspondent>
  </assignment-record>
  <patent-assignors xmlns="http://puneet/assignors">
    <patent-assignor>
      <name>TSAI, YU-WEN</name>
      <execution-date>
        <date>20050331</date>
      </execution-date>
    </patent-assignor>
    <patent-assignor>
      <name>HUANG, CHENG-I</name>
      <execution-date>
        <date>20050331</date>
      </execution-date>
    </patent-assignor>
  </patent-assignors>
  <patent-assignees xmlns="http://puneet/assignees">
    <patent-assignee>
      <name>FARADAY TECHNOLOGY CORP.</name>
      <address-1>NO.10-2, LI-HSIN ROAD 1, SCIENCE-BASED INDUSTRIAL PARK</address-1>
      <city>HSIN-CHU CITY</city>
      <country-name>TAIWAN</country-name>
    </patent-assignee>
  </patent-assignees>
</patent-assignment>

从这部XML中,你可以就每个“名称”要素制定范围索引,然后称为“姓名”部分。

cts:element-values(fn:QName("http://puneet/assignees", "name"))

查阅受让人名称。

问题回答

您可使用<代码>cts:path-range-query (,用于专利转让和专利-受让人

  1. cts:path-range-query("/patent-assignors/patent-assignor","=",$name)
  2. cts:path-range-query("/patent-assignees/patent-assignor","=",$name)

你们不需要担心该元素的父母或祖先。 您可以把元素-频率或元素-价值等级限制在元素-频率上:

cts:element-query(xs:QName("patent-assignor"), cts:element-value-query(xs:QName("name"), "my value"))

您可以按顺序按顺序按顺序按顺序逐字查询不同祖先的名字:

cts:element-query((xs:QName("patent-assignor"), xs:QName("patent-assignee")), cts:element-value-query(xs:QName("name"), "my value"))

HTH!





相关问题
how to represent it in dtd?

I have two element action and guid. guid is a required field when action is add. but when action is del it will not appear in file. How to represent this in dtd ?

.Net application configuration add xml-data

I need to add xml-content to my application configuration file. Is there a way to add it directly to the appSettings section or do I need to implement a configSection? Is it possible to add the xml ...

XStream serializing collections

I have a class structure that I would like to serialize with Xstream. The root class contains a collection of other objects (of varying types). I would like to only serialize part of the objects that ...

MS Word splits words in its XML format

I have a Word 2003 document saved as a XML in WordProcessingML format. It contains few placeholders which will be dynamically replaced by an appropriate content. But, the problem is that Word ...

Merging an XML file with a list of changes

I have two XML files that are generated by another application I have no control over. The first is a settings file, and the second is a list of changes that should be applied to the first. Main ...

How do I check if a node has no siblings?

I have a org.w3c.dom.Node object. I would like to see if it has any other siblings. Here s what I have tried: Node sibling = node.getNextSibling(); if(sibling == null) return true; else ...

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

热门标签