Last active
August 29, 2015 14:19
-
-
Save EdWarga/de3f1ea6b2b76f1df16c to your computer and use it in GitHub Desktop.
Replace value of all refids in collection with the normalized value
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 vra="http://www.vraweb.org/vracore4.htm"; | |
let $records := fn:collection("1941") | |
for $refid in $records//@refid | |
return | |
replace value of node $refid with fn:normalize-space($refid) |
Here's the documentation on the replace expression: http://docs.basex.org/wiki/XQuery_Update#replace
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The above code replaced all @refid with normalized version. This updated all the files in the db. I then exported the db to disk using the GUI (Export Data (BaseX: http://docs.basex.org/wiki/Databases#Export_Data)