Created
May 5, 2011 12:03
-
-
Save xquery/956929 to your computer and use it in GitHub Desktop.
using xpath id() function on xml:id
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(: 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