-
-
Save CliffordAnderson/c588a38b6c43d023d40d108b1befc8e7 to your computer and use it in GitHub Desktop.
Xquery for Unit Dates
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
(: This is as far as we got with the xquery command, simply trying to return the data contained in <unitdate> in a single doc for now.:) | |
xquery version "3.0"; | |
declare namespace ead = "urn:isbn:1-931666-22-9"; | |
let $doc := fn:doc("https://raw.githubusercontent.com/HeardLibrary/finding-aids/master/ASpace/Finalized%20EADs/8.30.17%20batch/HendrixNancy_MSS_206.xml") | |
for $unitdate in $doc//ead:dsc//ead:unitdate | |
let $gYear := fn:replace($unitdate, ".*(\d{4}).*", "$1") | |
return | |
copy $unitdate := $unitdate | |
modify insert node attribute { 'normal' } { $gYear } into $unitdate | |
return $unitdate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment