Skip to content

Instantly share code, notes, and snippets.

@meau
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meau/f4ba5c521919c279252c to your computer and use it in GitHub Desktop.
Save meau/f4ba5c521919c279252c to your computer and use it in GitHub Desktop.
Update an element so that it includes a nested element
xquery version "3.0";
declare namespace ead="urn:isbn:1-931666-22-9";
declare namespace xlink = "http://www.w3.org/1999/xlink";
for $container in ead:ead//ead:dsc/ead:c[2]//ead:did/ead:container[@type eq "Box"]
let $unittitle := $container/parent::ead:did/ead:unittitle
where $container = 10
return
replace node $unittitle with <unittitle><title render="italic">{$unittitle/text()}</title></unittitle>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment