malhenry
2006-05-11 17:59:02 UTC
Given the xml file below, I need to select 2 "incidents" based on the
following criteria.
City=TO
Active=1
Incident="Closed collision" or "Collision"
OR
Incident contains "Construct"
OR
any other incident
This seems more like a db query to me, rather than xml processing.
Is there a way for me to write code in MSXML to select the incidents I need
according to the above criteria?
It is unfortunate that the city node is NOT inside the incident node. This
is what the data vendor sends me.
Thanks.
<?xml version="1.0" encoding="ISO-8859-1" ?>
- <Tra>
<date>06-05-11</date>
<time>09:10:46</time>
<city>TO</city>
<sector>CE</sector>
- <incident>
<active>1</active>
<location>east of</location>
<route>Coxwell</route>
<incident>Construction</incident>
<lane>Right lane</lane>
</incident>
<city>TO</city>
<sector>NC</sector>
- <incident>
<active>1</active>
<location>at</location>
<route>407</route>
<incident>Broken watermain</incident>
<lane />
</incident>
<city>TO</city>
<sector>CC</sector>
- <incident>
<active>1</active>
<location>east of</location>
<route>Bathurst</route>
<incident>Closed repairs</incident>
<lane>All Lanes</lane>
</incident>
<city>TO</city>
<sector>NW</sector>
- <incident>
<active>1</active>
<location>at</location>
<route>Jane</route>
<incident>Closed repairs</incident>
<lane>All Lanes</lane>
</incident>
<city>TO</city>
<sector>CC</sector>
- <incident>
<active>1</active>
<location>between</location>
<route>Keele</route>
<incident>Construction</incident>
<lane>Right lane</lane>
</incident>
<city>TO</city>
<sector>CE</sector>
- <incident>
<active>0</active>
<location>approach</location>
<route>Whites Rd</route>
<incident>Collision</incident>
<lane>Left lane</lane>
</incident>
</Tra>
following criteria.
City=TO
Active=1
Incident="Closed collision" or "Collision"
OR
Incident contains "Construct"
OR
any other incident
This seems more like a db query to me, rather than xml processing.
Is there a way for me to write code in MSXML to select the incidents I need
according to the above criteria?
It is unfortunate that the city node is NOT inside the incident node. This
is what the data vendor sends me.
Thanks.
<?xml version="1.0" encoding="ISO-8859-1" ?>
- <Tra>
<date>06-05-11</date>
<time>09:10:46</time>
<city>TO</city>
<sector>CE</sector>
- <incident>
<active>1</active>
<location>east of</location>
<route>Coxwell</route>
<incident>Construction</incident>
<lane>Right lane</lane>
</incident>
<city>TO</city>
<sector>NC</sector>
- <incident>
<active>1</active>
<location>at</location>
<route>407</route>
<incident>Broken watermain</incident>
<lane />
</incident>
<city>TO</city>
<sector>CC</sector>
- <incident>
<active>1</active>
<location>east of</location>
<route>Bathurst</route>
<incident>Closed repairs</incident>
<lane>All Lanes</lane>
</incident>
<city>TO</city>
<sector>NW</sector>
- <incident>
<active>1</active>
<location>at</location>
<route>Jane</route>
<incident>Closed repairs</incident>
<lane>All Lanes</lane>
</incident>
<city>TO</city>
<sector>CC</sector>
- <incident>
<active>1</active>
<location>between</location>
<route>Keele</route>
<incident>Construction</incident>
<lane>Right lane</lane>
</incident>
<city>TO</city>
<sector>CE</sector>
- <incident>
<active>0</active>
<location>approach</location>
<route>Whites Rd</route>
<incident>Collision</incident>
<lane>Left lane</lane>
</incident>
</Tra>