Find dates that restrictions will be lifted
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 "3.0"; | |
declare namespace ead="urn:isbn:1-931666-22-9"; | |
declare namespace xlink = "http://www.w3.org/1999/xlink"; | |
declare namespace functx = "http://www.functx.com"; | |
<restrictions> | |
{ | |
for $ead in ead:ead | |
let $doc := base-uri($ead) | |
return | |
<document uri="{$doc}"> | |
{ | |
for $accessrestrict in $ead//ead:dsc//ead:accessrestrict/ead:p[matches(.,'(19|20)[0-9]{2}')] | |
let $series := $accessrestrict/ancestor::ead:c[@level = 'series' or @level = 'accession' or @level = 'accn']//ead:unitid | |
let $dateseg := fn:substring-after($accessrestrict,'until') | |
for $x in $series | |
return | |
<lookhere location="{$x}"> | |
{$accessrestrict} | |
<date>{$dateseg}</date> | |
</lookhere> | |
} | |
</document> | |
} | |
</restrictions> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment