0

I want to query an xml that is stored in a web page , the problem is that the xml is updated periodically each 5 minutes , it contains data from different bus in a city , here is the xml : enter link description here

I am looking for it in the documentation , but I don't see it

Thanks for the help

1 Answers1

2

I found the solution , I will post it if is useful for someone in the future .

Is as simple as this :

xquery version "3.0";

declare namespace bus="http://docs.gijon.es/sw/busgijon.asmx";

//we store the xml in this variable ,
let $buses := doc('http://datos.gijon.es/doc/transporte/busgijontr.xml')

//and for now on , you use the variable instead of doc(...)
for $b in $buses//llegadas/bus:llegada
where $b/bus:idparada=100
order by $b/bus:minutos,$b/bus:idlinea
return <proximosbuses>{$b/bus:idlinea, $b/bus:minutos}</proximosbuses>