I have the following XML, returned from a web service (5 extra points for guessing the movie):
<ArrayOfSub xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/">
<Sub>
<SubId>862</SubId>
<SubStreamId>1</SubStreamId>
<SubTimeStart>00:01:04.4450000</SubTimeStart>
<SubTimeEnd>00:01:08.2450000</SubTimeEnd>
<SubText>Wikus van de Merwe
MNU Alien Affairs
</SubText>
</Sub>
<Sub>
<SubId>863</SubId>
<SubStreamId>1</SubStreamId>
<SubTimeStart>00:02:11.3430000</SubTimeStart>
<SubTimeEnd>00:02:14.8430000</SubTimeEnd>
<SubText>Sarah Livingstone
Sociologist, Kempton Park University
</SubText>
</Sub>
</ArrayOfSub>
I need the <SubText>
element for all elements meeting the following conditions:
SubTimeStart < now && SubTimeEnd > now
I'm doing this in Javascript, for a WebOs app on the Palm Pre. I'm not sure exactly what resolution would be appropriate for my prototype.js PeriodicExecuter, but 1/100th of a second seems to be working OK.
What XPath query will return the element representing what's supposed to be on the screen right now?