I have a two xml files schema is identical.
When I read file into dataset and then bind dataset to the form.
These are weather files we are getting from weather service.
One file has only local weather so I don't have any problems with that,
but other has weather for several different locations.
Basically I need to select only weather for location if I know its code.
I should have exactly same dataset so I will be able bind it to the same
form without recoding.
I was trying to use dataview, but dataview works only with one table and
doesn't produce dataset.
I got it working by looping through table and removing rows that are not
correspond to the location I am interested in (rest of the related rows
removed automatically). This is works, but it is very inefficient and
dumb approach.
There is got to be a way to select from xml file only data I need so it
will create dataset only with one element I need.
Here is example of xml files.
If it is possible can someone give example using VB.net or C# so I don't
have create additional XSL pages
1************** This one works fine
<?xml version="1.0" encoding="ISO-8859-1" ?>
<weather>
<timestamp zone="GMT">02/11/2004 17:31</timestamp>
<current>
<citycode>LON X</citycode>
<day>
<name>Today</name>
<conditions wxcode="06">M/CLOUDY</conditions>
<temperature unit="F">38</temperature>
<apparent_tempe rature unit="F">38</apparent_temper ature>
<wind_chill_tem perature unit="F">29</wind_chill_temp erature>
<humidity unit="%">35</humidity>
<pressure unit="INHG">29. 99</pressure>
<windspeed unit="MPH">17</windspeed>
<wind_from>WN W</wind_from>
<visibility unit="MI">10</visibility>
</day>
</current>
<copyright>Copy right AccuWeather, Inc. 2004</copyright>
</weather>
2************** * This one needs to be fixed see comment
<?xml version="1.0" encoding="ISO-8859-1" ?>
<weather>
<timestamp zone="GMT">02/11/2004 17:31</timestamp>
<!-- cityCode will be passed to function and it should select current
only for this city -->
<current>
<citycode>OEM A</citycode>
<day>
<name>Today</name>
<conditions wxcode="35">P/CLOUDY</conditions>
<temperature unit="F">79</temperature>
<apparent_tempe rature unit="F">78</apparent_temper ature>
<wind_chill_tem perature unit="F">79</wind_chill_temp erature>
<humidity unit="%">33</humidity>
<pressure unit="INHG">29. 98</pressure>
<windspeed unit="MPH">10</windspeed>
<wind_from>W</wind_from>
<visibility unit="MI">7</visibility>
</day>
</current>
<current>
<citycode>OBB I</citycode>
<day>
<name>Today</name>
<conditions wxcode="33">CLE AR</conditions>
<temperature unit="F">66</temperature>
<apparent_tempe rature unit="F">68</apparent_temper ature>
<wind_chill_tem perature unit="F">66</wind_chill_temp erature>
<humidity unit="%">88</humidity>
<pressure unit="INHG">30. 07</pressure>
<windspeed unit="MPH">6</windspeed>
<wind_from>EN E</wind_from>
<visibility unit="MI">7</visibility>
</day>
</current>
<current>
<citycode>EHA M</citycode>
<day>
<name>Today</name>
<conditions wxcode="07">CLO UDY</conditions>
<temperature unit="F">41</temperature>
<apparent_tempe rature unit="F">44</apparent_temper ature>
<wind_chill_tem perature unit="F">36</wind_chill_temp erature>
<humidity unit="%">90</humidity>
<pressure unit="INHG">N/A</pressure>
<windspeed unit="MPH">6</windspeed>
<wind_from>NN E</wind_from>
<visibility unit="MI">8</visibility>
</day>
</current>
<current>
<citycode>EAN X</citycode>
<day>
<name>Today</name>
<conditions wxcode="38">M/CLOUDY</conditions>
<temperature unit="F">46</temperature>
<apparent_tempe rature unit="F">49</apparent_temper ature>
<wind_chill_tem perature unit="F">44</wind_chill_temp erature>
<humidity unit="%">84</humidity>
<pressure unit="INHG">N/A</pressure>
<windspeed unit="MPH">4</windspeed>
<wind_from>NN W</wind_from>
<visibility unit="MI">7</visibility>
</day>
</current>
<copyright>Copy right AccuWeather, Inc. 2004</copyright>
</weather>