Loading TOC...

MarkLogic Server 11.0 Product Documentation
trgr:document-scope

trgr:document-scope(
   $uri as xs:string
) as element(trgr:document-scope)

Summary

Returns the XML representation of a document scope, usable as the scope parameter of a trigger event constructor such as trgr:trigger-data-event .

Parameters
uri The document uri.

Example

xquery version "1.0-ml";
import module namespace trgr="http://marklogic.com/xdmp/triggers" 
   at "/MarkLogic/triggers.xqy";

trgr:trigger-data-event(
  trgr:document-scope("/myDir/interesting.xml"),
  trgr:document-content("modify"),
  trgr:post-commit())

  => A collection modification trigger event that may
     be used to create a trigger which fires whenever the
     document with URI /myDir/interesting.xml is modified.
  

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