<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/xdmp.documentSetProperty.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>xdmp.documentSetProperty</api:function-name><api:suggest>xdmp.documentsetproperty</api:suggest><api:suggest>xdmp</api:suggest><api:suggest>documentsetproperty</api:suggest><api:function-link mode="xquery" fullname="xdmp:document-set-property">/apidoc/8.0/xdmp:document-set-property.xml</api:function-link><api:function mode="javascript" name="documentSetProperty" type="builtin" lib="xdmp" category="UpdateBuiltins" hidden="false" bucket="MarkLogic Built-In Functions" prefix="xdmp" namespace="http://marklogic.com/xdmp" fullname="xdmp.documentSetProperty"><api:summary>
  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.
</api:summary><api:params><api:param name="uri" type="xs:string"><api:param-description>
    The document URI for the property setting.
  </api:param-description><api:param-name>uri</api:param-name><api:param-type>String</api:param-type></api:param><api:param name="prop" type="element()"><api:param-description>
    The property to set.
  </api:param-description><api:param-name>prop</api:param-name><api:param-type>Node</api:param-type></api:param></api:params><api:return>null</api:return><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
declareUpdate();
xdmp.documentSetProperty("/example.json", 
   xdmp.unquote('&lt;priority&gt;2&lt;/priority&gt;').next().value.root);
=&gt; ()
</pre></api:example></api:function></api:function-page>