Last active
December 18, 2015 22:09
-
-
Save caschwartz/5852546 to your computer and use it in GitHub Desktop.
XQuery - Query to find and correct problem names in the theocom database
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"; | |
(: 5/1/13 This query find and corrects problem names in the theocom database :) | |
declare namespace ia = "http://digital.library.ptsem.edu/ia"; | |
for $doc in xdmp:directory("/ia-xml/h/hi/his/", "infinity") | |
let $name := $doc/ia:doc/ia:metadata/ia:name | |
let $newNameNode := <name xmlns="http://digital.library.ptsem.edu/ia">Goodspeed, Edgar J. (Edgar Johnson), 1871–1962</name> | |
where fn:contains($name, "Young, Edward J.") | |
return xdmp:node-replace($name, $newNameNode) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment