Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
declare function local:change($node)
{
typeswitch($node)
case element(change-me) return
element { xs:QName("dmc:" || fn:local-name($node)) } {
$node/@*,
$node/node() ! local:change(.)
}
case element(name) return element name { "redacted" }
case element(count) return
element count {
xs:int($node) + 1
}
case element() return
element { fn:node-name($node) } {
$node/@*,
$node/node() ! local:change(.)
}
default return $node
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment