Page 1 of 1

XML parseing - Newbie trying to figure out how to.

Posted: Sat Jul 12, 2003 8:13 am
by Kibagami
Hello there.

I know this sounds like a noobish question, but newbies like me tends to ask them sometimes hehe. I'm very new to php and programming, and I'm learning new stuff everyday. Atm I'm trying to make a little website for the the Planetside outfit I'm in. Just the basics stuff and a forum.

Then I came over reading about XML parseing, and begun to read more. Reason for doing so is that I have a XML document of the planetside outfit rooster, and I'm trying to get it to view in a php document.
http://stats.planetsidegaming.com/outfi ... /stats.xml

I've tried countless times, but i keep failing everytime hehe.. I either end up with a blank page, or a page full of function errors hehe (yes I'm a very newbie)

Lately I've been trying to follow a guide at http://www.analysisandsolutions.com/code/phpxml.htm and this link is very helpful, but since i still dont understand how to make it work after reading this, then maybe I should just give up =(. The guide makes it look so easy, but I find it hard hehe.

The TAG's I'm trying to fetch is <name></name>, <title></title>, <battlerank></battlerank>, <points></points> and <lastloggedin></lastloggedin>, and trying to put them into a nice tabel,

I'm not asking anyone to write the php file for me or anything, I just need some pinpointers, suggestion, advices, to get me back into the spirit of trying :) (but if anyone wants to write it, I'll be extremly happy also hehe)

Thanks on advanced :D

Mvh
Erik Rasmussen
erik@w2r.net

Posted: Sat Jul 12, 2003 9:40 am
by m3rajk
if you don't have a good book (i recommmend the oreilly ones. isbn 1565926102 and 1565926811) then this site is rather helpful: http://www.php.net

http://us2.php.net/manual/en/function.preg-grep.php
http://us2.php.net/manual/en/function.preg-match.php
http://us2.php.net/manual/en/function.p ... ch-all.php

those links are from that site. they might just be what you're looking for.
you asking about regular expressions and perl have non-greedy abilities, so since posix doesn't you should use perl if possible

Posted: Sat Jul 12, 2003 12:00 pm
by Kibagami
ahh thanks =D, those links where hard to understand, but I belive I am a step closer now =)

(managed to fetch a tag hehe)

thanks for the fast reply also

PS. gonna check up on those books, those might help me alot in the future aswell :D

Mvh
Erik Rasmussen

Posted: Sat Jul 12, 2003 1:16 pm
by m3rajk
np. it's easy to make a fast reply when i'm online checking my thread when you post yours.

play with this and tell me what you think of it: http://people.brandeis.edu/~m3rajk/JMT/ ... c-fcv4.php

if you like it, then you should know it's done with preg_replace() and preg_split(). if you think it's good and want my help with what you're doing, since it woulds to me like it's something similar, then if you don't have a messenger service, you should get one, then pm me your name. i can give you pointers and we can chat real-time. it will be faster and and if i figure out how you learn (something i tend to do with people) i can figure out exactly how to give you the information to get it done so that you'll learn the how and why it works

Posted: Sat Jul 12, 2003 5:47 pm
by McGruff
There's a script in here whih might be helpful:

viewtopic.php?t=10507&highlight=utility+functions