Rac*_*pal 6 xml xquery marklogic marklogic-8 mlcp
我正在使用MLCP(Marklogic内容泵)将内容从一个数据库复制到另一个数据库.在这个我使用-query_filter选项,它的值是一个cts:查询以XML序列化格式的一组cts:element-range-query包装在cts:and-query中:
<cts:and-query xmlns:cts="http://marklogic.com/cts">
<cts:element-range-query operator=">">
<cts:element xmlns:c="http://iddn.icis.com/ns/core">c:released-on</cts:element>
<cts:value xsi:type="xs:dateTime" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">2000-12-21T00:00:00Z</cts:value>
</cts:element-range-query>
<cts:element-range-query operator="<">
<cts:element xmlns:c="http://iddn.icis.com/ns/core">c:released-on</cts:element>
<cts:value xsi:type="xs:dateTime" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">2016-12-21T00:00:00Z</cts:value>
</cts:element-range-query>
</cts:and-query>
Run Code Online (Sandbox Code Playgroud)
现在,上面的查询在ML Qconsole上执行时返回有效结果,但是当传入MLCP的-query_filter选项时,它会给出错误"无效属性值字符"<'.
Marklogic和MLCP的版本是8.0-5.
在进一步深入研究这个问题时,我发现只有当运算符值小于'<'时才会出现问题.
注意:我已在数据库中为"已启动"元素配置了有效的范围索引.
MarkLogic鼓励在使用序列化为XML 的cts 查询时使用选项文件,因为底层操作系统可以在命令行上解释特殊字符。
我的第一个猜测是尝试创建一个文件,例如options.txt包含以下内容:
--query_filter
<cts:and-query xmlns:cts="http://marklogic.com/cts">
<cts:element-range-query operator=">">
<cts:element xmlns:c="http://iddn.icis.com/ns/core">c:released-on</cts:element>
<cts:value xsi:type="xs:dateTime" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">2000-12-21T00:00:00Z</cts:value>
</cts:element-range-query>
<cts:element-range-query operator="<">
<cts:element xmlns:c="http://iddn.icis.com/ns/core">c:released-on</cts:element>
<cts:value xsi:type="xs:dateTime" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">2016-12-21T00:00:00Z</cts:value>
</cts:element-range-query>
</cts:and-query>
Run Code Online (Sandbox Code Playgroud)
(不过,您可能必须使所有XML适合该文件的同一行)
然后调用MLCP
mlcp.sh -options_file options.txt ...