I'm trying to parse a page that displays train running info, more specifically I want it to pull out ONLY the results for a specific operator. The problem is that the xml is formatted in such a way that the term that identifies the operator occurs AFTER the information I wanna grab.
Is there anyway to return info that occurs before the search term?
Here's an example
Code: Select all
<infomation>Hello</infomation>
<indentify>This one</indentify>
Edit heres and example of the actual code I wanna grab from
Code: Select all
<update type="departure">
<mode>train</mode>
<service>24782000</service>
<train_uid>W65347</train_uid>
<origin_name>Sutton (Surrey)</origin_name>
<destination_name>London Victoria</destination_name>
<platform>1</platform>
<operator>SN</operator>
<aimed_departure_time>15:26:00</aimed_departure_time>
<expected_departure_time>15:27:00</expected_departure_time>
<best_departure_estimate_mins>0</best_departure_estimate_mins>
<aimed_arrival_time>15:26:00</aimed_arrival_time>
<expected_arrival_time>15:27:00</expected_arrival_time>
<best_arrival_estimate_mins>0</best_arrival_estimate_mins>
<status>LATE</status>
<source>Network Rail</source>
</update>