Created
June 9, 2014 11:15
-
-
Save ableasdale/ab5dea6d883cc7a9c404 to your computer and use it in GitHub Desktop.
MD5 Checksum for document and all associated properties
This file contains hidden or 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"; | |
declare function local:get-document-collections-ordered($uri as xs:string) as xs:string { | |
for $i in xdmp:quote(xdmp:document-get-collections($uri)) | |
order by $i | |
return $i | |
}; | |
declare function local:calculate-md5-checksum($uri as xs:string) as xs:string { | |
xdmp:md5(fn:concat( | |
xdmp:quote(fn:doc($uri)), | |
xdmp:quote(xdmp:document-properties($uri)), | |
local:get-document-collections-ordered($uri) | |
)) | |
}; | |
(: Module main :) | |
for $x in cts:uris() | |
return | |
( | |
$x, | |
local:calculate-md5-checksum($x) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment