help xml parser

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
yaron
Forum Contributor
Posts: 157
Joined: Fri Aug 22, 2003 8:40 am

help xml parser

Post by yaron »

Hello,
I'm using xml parser to get data from xml file to mySql.
I get the data from the startElement function:

startElement($parser, $name, $attribs)

each time the startElement is called I store the tag attris (that what I need). all attris together are 1 row in my db.
The problem is that I want to enter to the same row another parameter which is not one of the attris (the xml file name for example).
of course startElement doesn't get this info and I don't know how send the function this addition.
I can't see the call for that function.
I even tried to make a global variable but with no results.
any ideas?
Thank you all
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

Script problems and how to's should be posted in the normal forum. The advanced forum is more for theoretical or in depth discussion of programming techniques - please read the sticky thread.

A discussion on the different approaches to parsing xml might be an advanced topic, but a problem with a specific script is not.

Thanks.
User avatar
BDKR
DevNet Resident
Posts: 1207
Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:

Post by BDKR »

Have you checked PHPBuilder.com. There is a tutorial over there on parsing XML files. As I said elsewhere, I'm not a big XML guy, but I've read and chewed on this tutorial and it did help. :-)

Cheers,
BDKR
Post Reply