Last active
December 21, 2015 21:38
-
-
Save caschwartz/6369171 to your computer and use it in GitHub Desktop.
XQuery - Query headers in EAD documents and create a new text nodes with the colons removed using MarkLogic imperative 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"; | |
(: 8/27/13 Query all headers in EAD documents and create a new text nodes with the colons removed using MarkLogic imperative function :) | |
declare namespace ead = "urn:isbn:1-931666-22-9"; | |
let $docs := xdmp:directory("/EAD/") | |
let $headers := $docs/ead:ead//ead:head | |
for $header in $headers | |
where fn:ends-with($header, ":") | |
order by $header | |
return xdmp:node-replace($header/text(), text{ fn:replace($header, ":$", "") }) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment