Skip to content

Instantly share code, notes, and snippets.

@CliffordAnderson
Created December 16, 2025 16:09
Show Gist options
  • Select an option

  • Save CliffordAnderson/5626cfe098f3792b848e3fb3efeb6063 to your computer and use it in GitHub Desktop.

Select an option

Save CliffordAnderson/5626cfe098f3792b848e3fb3efeb6063 to your computer and use it in GitHub Desktop.
For Arne
xquery version "3.1";
let $id := "EB010103"
let $doc := fn:collection()/TEI.2[@id = $id]
let $title := ($doc//body/div/head/data())[1]
let $date := $doc//sourceDesc/bibl/date/text()
let $heft := $doc//titleStmt//title/text() => fn:replace(".*heft *(.), *article *(.)", "$1")
let $article := $doc//titleStmt//title/text() => fn:replace(".*heft *(.), *article *(.)", "$2")
let $author := $doc//docAuthor/text()
let $starting-page := $doc//sourceDesc/bibl/biblScope/text() => fn:replace(".*?(\d+)-(\d+)", "$1")
let $ending-page := $doc//sourceDesc/bibl/biblScope/text() => fn:replace(".*?(\d+)-(\d+)", "$1")
let $fileDesc := $doc//fileDesc
return
<TEI>
{$fileDesc}
{$title}
</TEI>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment