Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
reading an xml file? and tag attributes
Old 05-25-2012, 04:52 AM reading an xml file? and tag attributes
numbenator's Avatar
Webmaster Talker

Posts: 534
Location: London
Trades: 0
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 pollen-forecast & each region extracting both the <forecast> attribute values ie "middaytime" and the <forecast> value.

My objective is that i have to determine which <forecast> value to use given the value of <forecast middaytime>.value

How can i do this please?

Cheers

Steve
__________________

Please login or register to view this content. Registration is FREE
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
 
Register now for full access!
Old 05-26-2012, 09:48 AM Re: reading an xml file? and tag attributes
King Spam Talker

Posts: 1,110
Name: Paul W
Trades: 0
See the php manual XML section
__________________
Great music:
Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
PaulW is online now
Reply With Quote
View Public Profile
 
Old 06-06-2012, 08:47 PM Re: reading an xml file? and tag attributes
Physicsguy's Avatar
404 - Title not found

Posts: 1,066
Name: Scott Kaye
Location: Ontario
Trades: 0
Mainly this. I was working on code to get your code to work, but I'm not quite sure what you're looking for.
__________________

Please login or register to view this content. Registration is FREE
Physicsguy is online now
Reply With Quote
View Public Profile Visit Physicsguy's homepage!
 
Reply     « Reply to reading an xml file? and tag attributes
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.15575 seconds with 11 queries