Forked from davidamichelson/Build Anonymous Name
Last active
August 16, 2016 21:29
-
-
Save wsalesky/9cd661d7c2274e5115f97ecad9559421 to your computer and use it in GitHub Desktop.
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
let $list := ("http://syriaca.org/person/1631", "http://syriaca.org/person/1442") | |
for $item in $list | |
let $uri := $item | |
return | |
for $idno in fn:collection('/db/apps/srophe-data/data/persons/tei')//tei:person[tei:idno[. = $uri]] | |
let $name := $idno/tei:persName[@xml:lang="en"][contains(@syriaca-tags,"#syriaca-headword")] | |
let $newName := | |
<persName xmlns="http://www.tei-c.org/ns/1.0" xml:id="{concat('name',substring-after($idno,'/person/'),'-a')}" | |
xml:lang="en" syriaca-tags="#syriaca-headword">Anonymi {substring-after($idno,'/person/')}</persName> | |
return | |
( | |
update value $name/@syriaca-tags with 'NEW ATTRIBUTE VALUE', | |
update insert $newName preceding $name | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment