Difference between revisions of "XQuery Recipes"
Jump to navigation
Jump to search
| Line 1: | Line 1: | ||
| − | This page contains code snippets that mainly originate from our [https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk | + | This page contains code snippets that mainly originate from our [https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk basex-talk] mailing list. |
== Computed Elements == | == Computed Elements == | ||
Revision as of 02:29, 24 January 2011
This page contains code snippets that mainly originate from our basex-talk mailing list.
Computed Elements
Returns dynamically named elements:
let $name:= "Element1"
let $class := "hi"
let $contents :=<foo><br />Bar!</foo>
return element { $name } {
attribute { "about" } { $class }, $contents
}
The result is an element named "Element1":
<Element1 about="hi">
<foo>
<br/>Bar!</foo>
</Element1>