Skip to content

Instantly share code, notes, and snippets.

@vai2fc
Created April 14, 2017 21:27
Show Gist options
  • Save vai2fc/bdcfc5c6607ec4ab43a09c988251d347 to your computer and use it in GitHub Desktop.
Save vai2fc/bdcfc5c6607ec4ab43a09c988251d347 to your computer and use it in GitHub Desktop.
xquery version "3.1";
declare namespace tei = "http://www.tei-c.org/ns/1.0";
let $doc := "/bluemountain-transcriptions/periodicals/bmtnaab/issues/1920/02_01/bmtnaab_1920-02_01.tei.xml"
for $id in fn:doc($doc)/tei:TEI//*/fn:data(@xml:id)
let $metadata := fn:doc($doc)/tei:TEI//*[@xml:id=$id]
let $article := fn:doc($doc)/tei:TEI//*[@corresp=$id]
let $tei :=
<tei:TEI>
<tei:teiHeader>
<tei:fileDesc>
<tei:titleStmt>
<tei:title>
</tei:title>
</tei:titleStmt>
<tei:publicationStmt>
<tei:p></tei:p>
</tei:publicationStmt>
<tei:sourceDesc>
<tei:biblStruct>
{$metadata}
</tei:biblStruct>
</tei:sourceDesc>
</tei:fileDesc>
</tei:teiHeader>
<tei:text>
<tei:body>
{$article}
</tei:body>
</tei:text>
</tei:TEI>
return $tei
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment