-
-
Save wsalesky/e95523ebe819f8c24bfc26ffe1796799 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"; | |
declare function local:download-xml($node, $filename) { | |
response:set-header("Content-Disposition", concat("attachment; | |
filename=", $filename)) | |
, | |
response:stream( | |
$node, | |
'indent=yes' (: serialization :) | |
) | |
}; | |
let $results := | |
for $name in fn:collection('/db/apps/srophe-data/data/persons/tei')//tei:person[tei:persName[@xml:lang='en']contains([@syriaca-tags,"#syriaca-headword")]] | |
let $en := $name/tei:persName[@xml:lang="en"] | |
let $gedsh := $name/tei:persName[@xml:lang="en-x-gedsh"] | |
let $uri := replace($name/ancestor::tei:TEI/descendant::tei:idno[1],'/tei','') | |
let $id := xs:integer(replace($uri,'http://syriaca.org/person/','')) | |
order by $id | |
return <p><idno>{$uri}</idno>{$name}{$gedsh}</p> | |
return | |
local:download-xml($results, "allnames.xml") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hmm that didn't work, but I think this did: https://gist.github.com/davidamichelson/a216712476d7a07405316510344a2738
Thanks!