Reputation: 2247
I can successfully run an xquery FLOWR on an xml doc:
for $result in doc(results.xml)////sparql/results/result/binding
where $result/@name="xyz"
return $result
What if i want to run the same FLOWR on a variable instead?
for $result in $results//sparql/results/result/binding
where $result/@name="xyz"
return $result
this does not work. What's the correct syntax?
Upvotes: 0
Views: 52
Reputation: 163322
If $results
is a document node then your syntax is correct.
If $results
is a URI containing the location of a document that needs to be parsed, then you want doc($results)//.....
.
Upvotes: 1