Xquery for Unit Dates
✓ Published0🌍 Public
CCliffordAnderson
Last edited Oct 13, 2017
Created on Oct 13, 2017
This example demonstrates a preprocessing step for visualizing dates in archival finding aids, extracting four-digit years from `<unitdate>` elements in a single EAD XML document. The XQuery script uses the XQuery 3.0 `copy` and `modify` expressions to insert a `normal` attribute containing the extracted year onto each unitdate node. It leverages a namespace declaration for the EAD standard and the `fn:doc` and `fn:replace` functions to fetch the remote XML file from GitHub and parse the date text via regular expressions. The output is the modified XML nodes, ready for downstream temporal analysis or charting.
AI-generated description