-
-
Save davidamichelson/9c8c74a5353cc2323b4d5e506089d7aa to your computer and use it in GitHub Desktop.
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 "3.0"; | |
declare namespace tei = "http://www.tei-c.org/ns/1.0"; | |
let $list := ("http://syriaca.org/person/1210", "http://syriaca.org/person/1211") | |
for $uri in $list | |
return | |
for $person in fn:doc('/db/apps/srophe-data/data/persons/tei/saints/tei/1210.xml')//tei:person[tei:idno/text()[.=$uri]] | |
let $name := $person/tei:persName[@xml:lang="en"][contains(@syriaca-tags,"#syriaca-headword")] | |
let $bibl := $person/tei:bibl[1] | |
let $newName := | |
<persName xmlns="http://www.tei-c.org/ns/1.0" xml:id="{concat('name',substring-after($uri,'/person/'),'-a')}" | |
xml:lang="en" syriaca-tags="#syriaca-headword">Anonymi {substring-after($uri,'/person/')}</persName> | |
let $newbio := | |
<state type="group" source="#bib{substring-after($uri,'/person/')}-1"/> | |
let $newtrait := | |
<trait xml:lang="en"><label>anonymous</label></trait> | |
return | |
( | |
update value $name/@syriaca-tags with '#anonymous-description', | |
update insert $newName preceding $name, | |
update insert $newbio preceding $bibl, | |
update insert $newtrait preceding $bibl | |
) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@wsalesky, it wanted /text() after all, not sure why, but that made it work