looping through a xml file and getting attributes

numbenator

New Member
Hi all

I haev an xml file in the form of below

Code:
<pollen-forecast published="1337860800" type="grass">
    <summary>The tree pollen season has finished</summary>
    <region id="6" name="SWScotland">
        <forecast middaytime="1337860800" time="1337860800">L</forecast>
        <forecast middaytime="1337947200" time="1337947200">L</forecast>
        <forecast middaytime="1338033600" time="1338033600">L</forecast>
    </region>
    <region id="2" name="Highlands">
        <forecast middaytime="1337860800" time="1337860800">L</forecast>
        <forecast middaytime="1337947200" time="1337947200">L</forecast>
        <forecast middaytime="1338033600" time="1338033600">L</forecast>
    </region>
</pollen-forecast>

I need to loop through each region and collect both the forecast attribute values and forecast value.

How can i do this please?

Cheers


Steve
 
Top