Last active
December 18, 2015 22:09
-
-
Save caschwartz/5852617 to your computer and use it in GitHub Desktop.
XQuery - Query to add <dc:type> element to TEI documents in lectures database
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 "1.0-ml"; | |
(: 6/7/13 Query to add <dc:type> element to TEI documents in lectures database :) | |
declare namespace tei = "http://www.tei-c.org/ns/1.0"; | |
declare namespace localtei = "http://digital.library.ptsem.edu/lectures/tei"; | |
declare namespace dc = "http://purl.org/dc/elements/1.1/"; | |
for $teiDoc in xdmp:directory("/TEI/", "infinity") | |
let $id := $teiDoc/tei:TEI/tei:teiHeader/localtei:metadata/dc:identifier | |
let $newNode := <dc:type xmlns:dc="http://purl.org/dc/elements/1.1/">Lecture</dc:type> | |
return xdmp:node-insert-after($id, $newNode) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment