Skip to content

Instantly share code, notes, and snippets.

@xquery
Created May 5, 2011 12:03
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 xquery/956929 to your computer and use it in GitHub Desktop.
Save xquery/956929 to your computer and use it in GitHub Desktop.
using xpath id() function on xml:id
(: xml:id attribute needs to be unique within the specific document scope :)
let $xml := document{ <employees>
<employee xml:id="n001">
<name>Johny Rotten</name>
</employee>
<employee xml:id="n002">
<name>Billy Idol</name>
</employee>
</employees>}
return
$xml/id("n002")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment