[Ask] PHP and XML

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
christian_phpbeginner
Forum Contributor
Posts: 136
Joined: Sat Jun 03, 2006 2:43 pm
Location: Java

[Ask] PHP and XML

Post 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]
User avatar
christian_phpbeginner
Forum Contributor
Posts: 136
Joined: Sat Jun 03, 2006 2:43 pm
Location: Java

Oke, my bad, sorry !

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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
User avatar
christian_phpbeginner
Forum Contributor
Posts: 136
Joined: Sat Jun 03, 2006 2:43 pm
Location: Java

Post 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 !
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Post Reply