Last active
August 8, 2016 01:08
-
-
Save davidamichelson/127edf8d6bdc346cec223927bb86b27d to your computer and use it in GitHub Desktop.
Grabs all Persnames for Editing
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"; | |
declare function local:download-xml($node, $filename) { | |
response:set-header("Content-Disposition", concat("attachment; | |
filename=", $filename)) | |
, | |
response:stream( | |
$node, | |
'indent=yes' (: serialization :) | |
) | |
}; | |
let $results := element div { | |
for $doc in fn:collection('/db/apps/srophe-data/data/persons/tei')//tei:person | |
let $en := $doc/tei:persName[@xml:lang='en'] | |
let $gedsh := $doc/tei:persName[@xml:lang='en-x-gedsh'] | |
let $id := replace($doc/descendant::tei:idno[1],'/tei','') | |
order by $id | |
return | |
<p xmlns="http://www.tei-c.org/ns/1.0" ref="{$id}"> | |
{$en} | |
{$gedsh} | |
</p>} | |
return | |
local:download-xml($results, "persnames.xml") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment