
dls:document-version( $uri as xs:string, $version-number as xs:unsignedInt ) as document-node()
This function returns a particular version of a managed document. An error is thrown if there is no such version.
| Parameters | |
|---|---|
| uri | The URI of the document. | 
| version-number | The version of the document to be returned. | 
dls-user role is required to run 
    this function, or the privilege:http://marklogic.com/xdmp/privileges/dls-user
    
  xquery version "1.0-ml";
  import module namespace dls = "http://marklogic.com/xdmp/dls" 
      at "/MarkLogic/dls.xqy";
  dls:document-update(
           "/foo/bar/baz.xml",
            dls:document-version( "/foo/bar/baz.xml", 1),
            "restoring from version 1", 
            fn:true() )
  (: Restores version 1 of the 'baz.xml' document. :)