XML : How to select an element by a variable in xquery?

I know how to select an element like so:

  $table/foo    

However how do I do this if the element name is stored as a variable. For example:

  let $x = "foo"  $table/[$x]    

I know how do this if it was a property from: How to select an attribute by a variable in xquery?

No comments:

Post a Comment