Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/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 - Fatal编程技术网

Marklogic 在现有元素节点中添加新属性

Marklogic 在现有元素节点中添加新属性,marklogic,Marklogic,我需要语法在现有元素节点中添加新属性。 样品 基础知识 . . . 07/06/2017 我想通过保持版本中的其余数据不变,向version元素添加新属性(myAttribute)。 例如 基础知识 . . . 07/06/2017 您可以使用,这也适用于属性: xdmp:document-insert("/test.xml", <version id="1" version-status="active"> <source/> <file-text&

我需要语法在现有元素节点中添加新属性。 样品


基础知识
.
.
.
07/06/2017
我想通过保持版本中的其余数据不变,向version元素添加新属性(myAttribute)。 例如


基础知识
.
.
.
07/06/2017
您可以使用,这也适用于属性:

xdmp:document-insert("/test.xml", <version id="1" version-status="active">
  <source/>
  <file-text>ABC</file-text>
  ...
  <file-date>07/06/2017</file-date>
</version>)

;

xdmp:node-insert-child(doc("/test.xml")/version, attribute myAttribute { "true" })

;

doc("/test.xml")
xdmp:documentinsert(“/test.xml”,
基础知识
...
07/06/2017
)
;
xdmp:节点插入子节点(doc(“/test.xml”)/version,属性myAttribute{“true”})
;
doc(“/test.xml”)

您可以使用,这也适用于属性:

xdmp:document-insert("/test.xml", <version id="1" version-status="active">
  <source/>
  <file-text>ABC</file-text>
  ...
  <file-date>07/06/2017</file-date>
</version>)

;

xdmp:node-insert-child(doc("/test.xml")/version, attribute myAttribute { "true" })

;

doc("/test.xml")
xdmp:documentinsert(“/test.xml”,
基础知识
...
07/06/2017
)
;
xdmp:节点插入子节点(doc(“/test.xml”)/version,属性myAttribute{“true”})
;
doc(“/test.xml”)

xdmp:document-insert("/test.xml", <version id="1" version-status="active">
  <source/>
  <file-text>ABC</file-text>
  ...
  <file-date>07/06/2017</file-date>
</version>)

;

xdmp:node-insert-child(doc("/test.xml")/version, attribute myAttribute { "true" })

;

doc("/test.xml")