您好我在下面提到了dls功能。但是我在结果窗口中遇到了一些错误。请告诉我任何遗漏我方的事情?
xquery version "1.0-ml";
import module namespace dls = "http://marklogic.com/xdmp/dls"
at "/MarkLogic/dls.xqy";
dls:document-update(
"/foo/bar/baz.xml",
错误
[1.0-ml] XDMP-DUPATTR: (err:XQDY0025) $child -- Two attributes with the same name
Stack Trace
In /MarkLogic/dls.xqy on line 1386
In add-xml-base(fn:doc("/foo/bar/baz_xml_versions/1-baz.xml")/ca, "/foo/bar/baz.xml")
$node := fn:doc("/foo/bar/baz_xml_versions/1-baz.xml")/ca
$uri := "/foo/bar/baz.xml"
$child := fn:doc("/foo/bar/baz_xml_versions/1-baz.xml")/ca/@xml:base
答案 0 :(得分:0)
似乎错误基于xml-base名称,可在Marklogic / dls.xqy文件中找到。在dls.xqy文件中的函数add-xml-base中,在返回输出值之前检查可用的任何条件。条件应检查xml基本名称,并且名称不匹配,然后返回输出值。以下示例将解决您的问题。
declare private function add-xml-base(
$node as node(),
$uri as xs:string)
{
element { fn:node-name($node) } {
(
attribute xml:base { $uri },
for $child in ($node/@*, $node/node())
where (fn:name($child) ne "xml:base")
return $child
)
}
};