PHP and XML Sitting in a Tree : Comments
February 4, 2007
Comments
Very nice article Kerri! You shed some light on many different ways I can meld my PHP skills with simple XML files. thank you.
xml was a scary beastie i wasnt looking forward to meeting, but now hes just a cute lil puppy that wants to be played with! thanks for the article… i look forwardd to the day when my (shared) hosting upgrades to PHP5!
Fine article, I found XML a little scary at first too. But this articles quite right!
This is an unusually good article. It is very difficult to use examples in articles like this, which are simple enough for newcomers to understand, yet complex enough to show off the power of the tool in question (in this case, SimpleXML). You’ve done a great job of doing both of these things!
Excellent article. This is going to prove astonishingly useful. I’ve been afraid of XSLT for so long but this looks a lot more like my cup o tea.
Thanks a lot! Very good article! Helped me a lot!
Nice article. XML is good. SimpleXML is a huge time saver.
HOWEVER:
simpleXML seems to be lacking functionality when it comes to xml files that use namespaces. It is possible to get the job done but it’s confusing and complicated compared to it’s normally easy to use functions for plain xml files.
I realized this when trying to make use of the xml feeds from Google Calendar
it’s easy to work with
<gd:when startTime=“300” />
using SimpleXML
but quite a pain to access startTime when the xml is written as
<when gd:startTime=“300” />
and to all you people afraid of xml, don’t be. It’s really a very simple and flexible concept. Only lack of tools/having to build your own tools is hard. And the related things like xslt probably have a learning curve but XML itself is simple.
nice thoughts. i have been using xml as content model since php4 (wrote my own simplexml class back then), now with all other good things php5 finally came with true xml support. great. but i have been wondering about performance issues on using xml for storing bigger amounts of data.
take an example – a sitemap. common strategy have been to hold individual sitemap leafs in database, so on request php retrieves path to requested leaf using a db query.
on the other hand, storing sitemap in xml is much more natural way as xml is by itself structured document as the sitemap is.
my question is, in what point it would be unneccesary overhead, comparing to mysql for example, of loading entire xml tree on each request to reconstruct structure path for requested leaf? i think same questions can be extended to several different usecases where an app architect should decide whether information should stored in database or flat xml files.
I use this extension to parse the XML-Definition of my DB-Schema to automate the creation and update of the tables, fields and indizes. It
Thanks for very interesting article. Can I translate your article into polish and publish at my webblog? I will back here and check your answer. Keep up the good work. Greetings
On my blog: Pozycjonowanie
Thanks for this article.I’m running several PHP-powered sites which mostly make use of XML (like Sofort Kredit).So this information is coming very handy to me.Regards, Bernd
Excellent article. This is going to prove astonishingly useful. I’ve been afraid of XSLT for so long but this looks a lot more like my cup o tea.Art
PHP is getting better and better, with all the XML/SOAP capabilities of PHP5 you need no more Harry Potter magic skills when you would like to use XML in web sites oder web applications. I’m using it for data exchange tastk with several web shops at HandyGO. Works like a charm.


You can use this
feed to keep up with the comments made on this article.