Loading TOC...

MarkLogic 10 Product Documentation
sec:get-amp

sec:get-amp(
   $namespace as xs:string,
   $local-name as xs:string,
   $document-uri as xs:string,
   $database as xs:unsignedLong
) as element(sec:amp)?

Summary

Returns an sec:amp element corresponding to an amp identified by ($namespace, $local-name, $document-uri). If no such amp is found, an error is returned.

Parameters
namespace Namespace of the function to which the amp applies.
local-name Name of function to which the amp applies.
document-uri URI of the document in which the function is located.
database Database ID in which the module is located. If the module is on the filesystem (in the Modules directory), specify xs:unsignedLong(0).

Usage Notes

This function must be executed against the security database.

Example


(: execute this against the security database :)
xquery version "1.0-ml";
import module namespace sec="http://marklogic.com/xdmp/security" at 
    "/MarkLogic/security.xqy";

sec:get-amp(
    "http://marklogic.com/xdmp/alert",
    "action-insert",
    "/MarkLogic/alert.xqy",
    0) 
=>

<sec:amp xmlns:sec="http://marklogic.com/xdmp/security">
  <sec:amp-id>2840630016131588040</sec:amp-id>
  <sec:namespace>http://marklogic.com/xdmp/alert</sec:namespace>
  <sec:local-name>action-insert</sec:local-name>
  <sec:document-uri>/MarkLogic/alert.xqy</sec:document-uri>
  <sec:database>0</sec:database>
  <sec:role-ids>
    <sec:role-id>4235709426772438321</sec:role-id>
  </sec:role-ids>
</sec:amp>
  

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