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?
Use AVTs (Attribute Value Templates) for this: