Linked by Eugenia Loli on Tue 27th Feb 2007 23:56 UTC, submitted by IdaAshley
General Development This first article of a three-part series introduces PHP5's XML implementation and help those relatively new to using XML with PHP to read, parse, and manipulate, and write a short and uncomplicated XML file using the DOM and SimpleXML in a PHP environment.
Permalink for comment 217271
To read all comments associated with this story, please click here.
RE[3]: Ugh XML
by robinh on Wed 28th Feb 2007 16:49 UTC in reply to "RE[2]: Ugh XML"
robinh
Member since:
2006-12-19

There's no supprise the JSON integrates better in to the PHP language, as it is effectively a cross-platform object persistence syntax. SimpleXML (or any xml binding API for that matter) suffers from the same problem: nested programming language constructs (arrays, hashes, objects etc) cannot represent 'complex' XML. (I'd post a example, but the forum software would swallow it!)

I've heard the argument many times that XML is bloat: and looking at an XML file, you can see what these people are getting at. However, XML tries to be a generic format, so it is inevitable that this will be less succinct than a format designed for a particular data set type. The advantage of using XML is that the same set of APIs can be re-used in many different situations.

Cheers
--Robin
ps. Why is XSLT a disadvantage?

Reply Parent Score: 1