N. America: 800 876 3101 | World: 44 (0) 1753 218 930

Can I use dynamic text as the name of a result node?

Yes, you can use computed constructors (http://www.w3.org/TR/xquery/#id-computedConstructors):

let $r := "some-dynamic-value"
return
    element {$r} {'something'}

to return...

<some-dynamic-value>something</some-dynamic-value>


Next Question!

How can I return the result of multiple expressions?

Submit Your DataDirect XQuery Tip or Trick

Tell us your XQuery Tip or Trick – if it gets published on our site, you’ll receive a

$10.00 Amazon.com
Gift Certificate!

Submit your tip or trick today.