Created
July 16, 2015 15:26
-
-
Save davidamichelson/857733cac083c270013b 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 "1.0"; | |
declare namespace tei="http://www.tei-c.org/ns/1.0"; | |
let $langs := ("syr", "syr-Syrn", "syr-Syrj", "en", "en-x-gedsh") | |
let $doc := fn:doc("13.xml") | |
for $person in $doc//tei:person | |
let $uri := $doc//tei:person//tei:idno/text() | |
for $name in $person/tei:persName | |
let $names := $name//text()[. = normalize-space(.)] | |
let $lang :=$name/@xml:lang/string() | |
where $name/@xml:lang = $langs | |
return | |
<row> | |
<uri>{$uri[1]}</uri> | |
<names>{fn:string-join($names, ",")}</names> | |
<lang>{$lang}</lang> | |
</row> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If there is a Syriac name, then export the following:
All Syriac names with language tags (and join name parts)
All English names with language tags (note need to normalize space and join name parts)
The URI for the person