Loading TOC...

xdmp:document-set-properties

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

Summary

Sets the properties of a document to the given sequence of elements, replacing any properties that already exist on the document. To preserve existing document properties, use xdmp:document-add-properties. Each element QName is the property name and the element value is the property value. Modifying properties requires update permissions on a document.

Parameters
$uri The URI of the document.
$props The properties to set. Replaces any properties already set on the document.

Example

  xdmp:document-set-properties(
         "example.xml",
         (<priority>1</priority>,
          <status>unedited</status>))
  => ()

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

Comments

The commenting feature on this page is enabled by a third party. Comments posted to this page are publicly visible.
  • Hi, I have an XML file say A.xml containing all the elements. I want to add all the elements from A.xml to A.pdf PROPERTIES. Is it possible? If yes, What can be the possible ways
    • xdmp:document-set-properties is the right function to use. The $uri will be "A.pdf" and the properties will be what you pull from A.xml. By the way, you'll likely get a faster response on <a href="http://stackoverflow.com/questions/ask?tags=marklogic">Stack Overflow</a> -- more people will see your question there. That will also give you space to show us what you've tried.
  • Some properties are special, and when trying to set them you'll get an XDMP-SPECIALPROP error. The docs at https://docs.marklogic.com/guide/messages/XDMP-en list a few examples: prop:last-modified, prop:content-length, and prop:directory. For prop:last-modified you can temporarily turn off "maintain last modified" if you want to manually push in a value.