/    Sign up×
Community /Pin to ProfileBookmark

Parsing XML Using PHP 4x

I wasn’t absolutely sure of where to put this post, here, in XML, or on the PHP listserv. I decided to start here.

Basically I have the configuration file to a site written in XML which I want to parse with PHP, and take those values and put them into action on a per-page basis. This I do through a couple of classes I wrote. My question arises due to the seemingly, cumbersome nature of how I managed to get the config settings out of the XML and into my PHP classes. To me it seems much to complex for PHP and I think I’m going about it in the wrong way. I will admit though, It is my first experience parsing XML with PHP so it may just seem complex since it is unfamiliar.

Here is an examle of my settings file: [url]http://blacknute.com/site_defaults.xml[/url]
And here is what I came up with to parse it: [url]http://blacknute.com/test.phptxt[/url]

It currently only retrives the data in the config area of the document, and if it was that complex to assemble setting and value pairs, I’m afriad getting links generated might be a little scary.

So, my basic question is, am I going about this the right way?

thanks!
–nathan

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@olafAug 13.2005 — I think you're on the right way... DOMXML is the thing you need or maybe you can better work with EXPAT...

and it's all about testing to get the right data... ?
×

Success!

Help @BlackNute spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...