looping through a xml file and getting attributes

Discussion in 'Programming' started by numbenator, May 25, 2012.

to remove all ads.
  1. numbenator

    numbenator New Member

    Messages:
    4
    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
     
  2. chrishirst

    chrishirst Well-Known Member Staff Member

    Messages:
    2,639
    Using what variety of code?
     

Share This Page