Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
web preko XML-a i php-a

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side
View previous topic :: View next topic  
Author Message
moko



Joined: 02 Dec 2003
Posts: 159
Location: zagreb

PostPosted: 01.08.2005 13:44    Post subject: web preko XML-a i php-a Add user to your forum ignore list Reply with quote

slab san i u jednom i drugom, ali mi treba nešto na brzinu da parsam jedan jednostavan document.
kako svrljan po tutorialima vidim da iman puno rupa pa mi skoro ni jedan ne koristi.

ma u biti muči me par stvari:

- instalacija ovog expat! jel ima ko volje i želje da mi to ukratko objasni?
- najednostavniji način parsanja da vidin jel to uopće radi
- kako postati besmrtan?

a dobro, uvažavaju se odgovori i samo na prva dva Smile
Back to top
View user's profile Send private message
unique



Joined: 29 Mar 2004
Posts: 655

PostPosted: 01.08.2005 15:22    Post subject: Add user to your forum ignore list Reply with quote

probat cu odgovorit na drugo
Code:
$pajser=xml_parser_create();
xml_set_element_handler($pajser, 'StartTag' , 'EndTag' );
xml_set_character_data_handler($pajser, 'CharData');
znaci 'narpavis', kreiras parser...
sljedeci korak je da mu odredis handler funkcije koje ce bit pozvane kad parser naidje na ... hm određeni 'trigger' npr. start_tag (tj. pocetak nekog elementa/node-a ili kako vec), end_tag, i char_data odnosno 'podatke', sadržaj, content :) nekog elementa....
kao sto gore vidis moje handler funkcije se zovu StartTag, EndTag i CharData...
(detalje potrazi po netu :)

evo kak trebaju biti 'deklarirane' funkcije...(necu dodatno objasnjavat, sve se vidi dolje, bar mislim :)
Code:
function StartTag($P, $TagName, &$TagAttributes)
function EndTag($P, $TagName)
function CharData($P, $Data)
obicno da bi znao o kojem se elementu/tagu/node-u radi kad ti parser 'vrati' cdata koristis neku varjablu npr. $CurrentTag ... .. ..

Code:
$file=fopen($FileName,'r');
$chunk=4*1024;
while($data=fread($file,$chunk)){
   xml_parse($pajser,$data,feof($file));
}
tu pozivas xml_parse i dajes mu komade od po 4kb....
Code:
xml_parser_free($pajser);
na kraju oslobodis parser :)

to bi bilo ukratko o parsanju...ima tu jos nekih stvari...
bilo bi dobro kad bi napiso o kakvoj se strukturi tvog xml-a radi...

ps. ako sam napiso neku glupost ili nesta :) budite slobodni da me ispravite "Sve prihvaćam stoički. S mitraljezom u ruci. Lijevoj. U desnoj je minobacač. Hvala"

_________________
Activate interlock! Dynotherms connected! Infracells up! Mega thrusters are go! LET'S GO VOLTRON FORCE!
Back to top
View user's profile Send private message
zytzagoo
mi3.crew


Joined: 25 Aug 2003
Posts: 1842
Location: Zagreb, Hrvatska

PostPosted: 02.08.2005 15:48    Post subject: Re: web preko XML-a i php-a Add user to your forum ignore list Reply with quote

moko wrote:
- kako postati besmrtan?

Treba ti essence of hakkar. I egg of hakkar.
Essence dropa u sunken temple-u, nakon sto zabijes ogromnog zmaja, a jaje moras pobrat u Jintha'aloru u pecini nakon sto ubijes keeper-a tamo.

Jaje moras napuniti essence-om i donijeti frajeru u steemwhedle port u tanarisu. Zaboravio sam kako se zove, al ne mozes ga promasit. On ti daje lifeforce dirk koji ima +11 stamina. Skoro besmrtan.
Back to top
View user's profile Send private message Visit poster's website Twitter profile
tRC



Joined: 07 Sep 2003
Posts: 1280

PostPosted: 02.08.2005 15:58    Post subject: Re: web preko XML-a i php-a Add user to your forum ignore list Reply with quote

zytzagoo wrote:
Skoro besmrtan.


A police officer pulled over a red Porsche after it had run a stop sign. He walked up to the car door and sain, "Sir, May I see your driver's license and registration please?"

The driver said, "What's the problem, officer?"

"Your just ran the stop sign back there at the last intersection."

"Oh, come on pal, there wasn't a car within miles of me!"

"Nevertheless sir, you are required to come to a complete stop, look both ways, and proceed with caution."

"You gotta be kidding me!"

"It's no joke, sir".

"Look, I slowed down almost to a complete stop, saw no one within twenty miles, and proceeded with caution."

"That's beside the point, sir. You are supposed to come to a complete stop, and you didn't. Now if I may see your license and..."

"You've got a lot of time on your hands, PAL! What's the matter, all the doughnut shops closed?"

"Sir, I'll overlook that last comment. Let me see your license and registration immediately!"

"I will, if you can tell me the difference between slowing down, and coming to a complete stop."

The police officer had enough and said to the driver, "Sir, I can do better than that." He opened the car door, dragged the obnoxious driver out, and proceeded to methodically beat him over the head with his nightstick.

"Now sir, would you like me to slow down or come to a complete stop?"

Almost Doesn't Count
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group