Skip to content

Instantly share code, notes, and snippets.

@KitWallace
Created August 21, 2012 22:37
Show Gist options
  • Save KitWallace/3420039 to your computer and use it in GitHub Desktop.
Save KitWallace/3420039 to your computer and use it in GitHub Desktop.
Challenge 1
declare function local:max_depth($node) {
if (exists($node))
then max($node/*/(local:max_depth(.) + 1))
else 0
};
let $n := <a> dsds<b>dsd<c/>sdd</b><b><c>sds<d/>dsd</c></b></a>
return local:max_depth($n)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment