Reputation: 24748
I have this XQuery element that is giving me an error:
let $mx := 7
for $b in doc("abc.xml")//test
where $b/@attr = $mx
return
<mytag myattr="$mx">
{$b/data(@name)}
</mytag>
I want to return the value of $mx as the myattr attribute. Any pointers?
Upvotes: 2
Views: 247
Reputation: 243459
Use AVTs (Attribute Value Templates) for this:
<mytag myattr="{$mx}">
Upvotes: 3