Created
December 10, 2013 22:00
-
-
Save caschwartz/7901026 to your computer and use it in GitHub Desktop.
XQuery - Corrected capitalization for collection headings in MODS documents
This file contains hidden or 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"; | |
| (: Fix capitalization of collection titles ("inventory" database) :) | |
| declare namespace mods = "http://www.loc.gov/mods/v3"; | |
| fn:distinct-values( | |
| for $doc in fn:collection("MODS") | |
| let $collection-title := $doc/mods:modsCollection/mods:mods/mods:titleInfo[@type="uniform"] | |
| let $normalized := fn:normalize-space($collection-title) | |
| where $collection-title (: Test for presence of collection heading :) | |
| order by $normalized | |
| return fn:replace($normalized, "collection", "Collection")) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment