Loading TOC...

dls:document-set-property

dls:document-set-property(
   uri as xs:string,
   property as element()
) as empty-sequence()

Summary

This function sets a property on a document. If any properties with the same property QName exist, they are replaced with the new property. If no properties exist with the same QName, the new property is added.

Parameters
uri The URI of the document.
property The property to set.

Required Privileges

The dls-user role is required to run this function, or the privilege:
http://marklogic.com/xdmp/privileges/dls-user

Usage Notes

You cannot set any property nodes in the DLS namespace.

Example

  xquery version "1.0-ml";

  import module namespace dls = "http://marklogic.com/xdmp/dls" 
      at "/MarkLogic/dls.xqy";

  dls:document-set-property(
              "/foo/bar/baz.xml", 
              <priority>1</priority>)

  (: The <priority> property is set to the 'baz.xml' document. :)
    

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.