I’m trying to perform a simple xquery operation to return a list of nodes whose attributes match a range of numbers
I have tried the following…
XML Source:
<cars>
<car id="1">Ford</car>
<car id="2">Mazda</car>
<car id="3">Toyota</car>
<car id="4">Lexus</car>
</cars>
XQuery:
let $i := 1
return //car[@id="{$i}"]
but it does not work. It seems so simple, can anyone tell me what’s wrong?
It’s even easier than that:
Result: