Last active
August 16, 2016 16:33
-
-
Save davidamichelson/a216712476d7a07405316510344a2738 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 $doc in fn:collection('/db/apps/srophe-data/data/persons/tei')//tei:person | |
let $name := $doc/tei:persName[@xml:lang='en'][contains(@syriaca-tags,"#syriaca-headword")] | |
let $gedsh := $doc/tei:persName[@xml:lang="en-x-gedsh"] | |
let $uri := replace($doc/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}<persName type="label">GEDSH:</persName>{$gedsh}</p> | |
return | |
local:download-xml($results, "allnamesbis.xml") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment