Loading TOC...

dls:document-set-properties

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

Summary

This function sets the properties of a document to the given sequence of elements. With the exception of the Library Services properties, any properties that already exist on the document are replaced. To preserve existing document properties, use dls:document-add-properties . Each element QName is the property name and the element value is the property value.

Note that properties are not maintained in version history unless changes are also made to the content of the document.

Parameters
uri The URI of the document.
properties The properties to be set for the document.

Required Privileges

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

Modifying properties requires update permissions on a document.

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-properties(
              "/foo/bar/baz.xml", 
              (<priority>1</priority>,
               <status>unedited</status>))

  (: The <priority> and <status> properties are 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.