Page 1 of 1

[Ask] PHP and XML

Posted: Thu Aug 03, 2006 5:25 am
by christian_phpbeginner
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Okay, I have downloaded the MagPieRSS, the latest version. And I know the basic how to parse XML file from the MagPie file. But I still have questions about how to parse the [color=green]<item>[/color] and all of its childnodes.

Let's say that I have a xml file like this:
[syntax="xml"]<rss version = "2.0">
      <channel>
         <title>Help me parsing XML using PHP</title>
         <description>Please help me parsing XML</description>
         <item>
            <title>Florida Wins</title>
            <link>http://www.somelinks.com/FloridaWins.php</link>
            <guid isPermaLink="false">ad20060803000000</guid>  
      </item>
   </channel>
</rss>
Now, what I can't do is, how do you parse the <item> tag, the <title>,the <link>, and the <guid> inside the <item> using MagPie ?..

And lastly, how would it work if I want to distribute this XMLnodes Values into HTML table ? Should I create an Array first to store the nodes value, and then distribute those value using loops, or how ?

Thanks !

Chris


feyd | Please use[/syntax]

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Oke, my bad, sorry !

Posted: Thu Aug 03, 2006 8:32 am
by christian_phpbeginner
Oh, I didn't know there is a syntax tag anyway...sorry..

By the way, I have found the solution myself....And I don't know why I haven't get any answers from this forum yet, just because of the mistakes I did ? Well, if it is...that's kinda cruel...lol...

There isn't any tutorial about RSS and PHP using MagPie in this forum anyway. Maybe I will post a new tutorial on it, because I am trying to get my job done first.

Once again, sorry to everyone...

Cheers,
Chris

Posted: Thu Aug 03, 2006 8:40 am
by feyd
I would imagine that you didn't get answers because
  • there may not be that many MagPie users here
  • you posted at a time when there aren't many people on the board that could reply

Posted: Thu Aug 03, 2006 9:17 am
by christian_phpbeginner
feyd wrote:I would imagine that you didn't get answers because
  • there may not be that many MagPie users here
  • you posted at a time when there aren't many people on the board that could reply
So, what do you usually use when parsing RSS or XML with PHP ? Do you all create your own functions ?

Thanks !

Posted: Thu Aug 03, 2006 9:24 am
by feyd