Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save davidamichelson/51d944109b2bd68b1249a96882d67d44 to your computer and use it in GitHub Desktop.

Select an option

Save davidamichelson/51d944109b2bd68b1249a96882d67d44 to your computer and use it in GitHub Desktop.
xquery version "3.0";
declare namespace tei = "http://www.tei-c.org/ns/1.0";
(: for each row/record in the persnames file :)
for $newname in fn:doc("/db/apps/workingdocs/persnamesdone.xml")//tei:div/tei:p/tei:persName
let $matchid := $newname/@xml:id
(: for each persName xml:id in Syriaca.org person records:)
let $oldname :=
for $name in fn:collection("/db/apps/srophe-data/data/persons/tei")//tei:person/tei:persName
where $name/@xml:id[.=$matchid]
return $name
return
update replace $oldname with $newname
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment