Skip to content

Instantly share code, notes, and snippets.

@ryanjdew
Created June 14, 2012 13:28
Show Gist options
  • Select an option

  • Save ryanjdew/2930284 to your computer and use it in GitHub Desktop.

Select an option

Save ryanjdew/2930284 to your computer and use it in GitHub Desktop.
In Memory Advanced Transform Statements, Example 1
(:
copy $c := fn:root($file)
modifiy (replace nodes $c/(: path where $file was :)/title with element title {"my new title"},
insert nodes attribute new-attribute {"my new attribute"} as last into
$c/(: path where $file was :))
return $c
=>
:)
(mem:queue(),
mem:replace($file/title, element title {"my new title"}),
mem:insert-child($file, attribute new-attribute {"my new attribute"}),
mem:execute())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment