Last active
April 26, 2018 09:21
-
-
Save nishantsingh1/aceae68726e5a20339cb0c55c8edfa56 to your computer and use it in GitHub Desktop.
TriggerExample: Shared Library module with a common function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version '1.0-ml'; | |
(: common util module :) | |
xdmp:document-insert("/SAMPLE/MODULE/sample-library.xqy", | |
text{ ' | |
xquery version "1.0-ml"; | |
module namespace minilibrary = "minilib"; | |
declare variable $dnamespace := "http://www.sample.net/schema/datahub"; | |
declare function get-metadata() as node() { | |
let $isoFormat := "[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01][Z]" | |
let $currentTS := current-dateTime() | |
let $currentISO := format-dateTime($currentTS, $isoFormat) | |
let $metadataCreated := element{QName($dnamespace, "createdTS") } {$currentISO} | |
return $metadataCreated | |
};' | |
}, xdmp:permission('app-user', 'execute')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment