Last active
August 16, 2016 14:28
-
-
Save davidamichelson/4d87c9740b638441bb120e7b21173c6d 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
| xquery version "3.0"; | |
| declare namespace tei = "http://www.tei-c.org/ns/1.0"; | |
| for $zptr in fn:collection("/db/apps/srophe-data/data/bibl/tei")//tei:idno[@type="zotero"]/text() | |
| let $uri := replace($zptr/ancestor::tei:TEI/descendant::tei:publicationStmt/descendant::tei:idno[@type="URI"][starts-with(.,'http://syriaca.org/')]/text(),'/tei','') | |
| let $oldptr := | |
| for $ptr in fn:collection("/db/apps/srophe-data/data/persons/tei")//tei:person/tei:bibl/tei:ptr | |
| where $ptr/@target/string()[.=$zptr] | |
| return $ptr | |
| return | |
| update replace $oldptr with <ptr xmlns="http://www.tei-c.org/ns/1.0" target="{$uri}"/> |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
replacezoterowithuriptr.xqy