[xquery-talk] Can I use a dynamic text as the name of result node?

Michael Kay mike at saxonica.com
Wed May 30 11:50:16 PDT 2007


Use a computed element constructor:
 
element {$r} {'something'}
 
Michael Kay
http://www.saxonica.com/


  _____  

From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf Of ??
Sent: 30 May 2007 10:26
To: talk at x-query.com
Subject: [xquery-talk] Can I use a dynamic text as the name of result node?


Hi,

How to create an xml fragment whose root name is dynamic? The following code is false, of course.

let $a := <a>bbb</a>
let $r := $a/text()
return
<{$r}>something</{$r}>

With namespace?

return
<{QName("http://aaa",concat($prefix,":",$r))}/>

Are there any methods to do this?

Thanks,
Lei



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://x-query.com/pipermail/talk/attachments/20070530/d9ad62aa/attachment.htm


More information about the talk mailing list