我在伦敦得到了一个车站 - 沃伦街车站,尤斯顿,我必须返回与沃伦街车站具有相同自行车可用性的车站,并且至少有很多空文档。我写了一个小查询来返回沃伦街车站及其可用性,但是我如何返回与我的沃伦街车站具有相同可用性/空码头的所有其他车站的列表?
<results>{ for $b in doc("http://tinyurl.com/TFLStationsXMLFile")
/stations/station
where $b/name = "Warren Street Station, Euston"
order by $b
return
<result>
{ $b/name }
{ $b/nb_bikes }
{ $b/nb_empty_docks }
</result>}
</results>
let $warren-station := doc("http://tinyurl.com/TFLStationsXMLFile")/stations/station[name eq "Warren Street Station, Euston"]
return
<results>{ for $b in doc("http://tinyurl.com/TFLStationsXMLFile")/stations/station
where $b/nb_bikes eq $warren-station/nb_bikes and $b/nb_empty_docks ge $warren-station/nb_empty_docks
order by $b
return
<result>
{ $b/name }
{ $b/nb_bikes }
{ $b/nb_empty_docks }
</result>}
</results>
类似的东西。哼!