Term Images for "SimpleXML Vs. SXML"

SimpleXML Vs. SXML

I had a chance to really play with PHPs native XML support.

It's interesting, but a little leaky in its abstraction. I had to futz around with the options to make it recognize CDATA sections, which involved passing options to libxml.

$xml = simplexml_load_file($file, 'SimpleXMLElement', LIBXML_NOCDATA);

Additionally, trying to serialize and unserialize SimpleXML objects is a dirty, hacky job. I didn't even bother trying to tackle that (though others have). In Short, native support for xml, isn't quite native inside of PHP.

This is quite a contrast from sxml, (S-expression XM) where it Just Works™. If I recall, the code to parse an xpath expression in SXML is dirt easy. On top of that, working with xml as native scheme/lisp lists is like mana from heaven! Though I guess PHP has native xpath as part of SimpleXML, but I wonder how easy it would be to write an xpath parser?

Anyway, Native XML handling, no matter the language, rocks.

Your rating: None

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
The fucking spammers are ruining the internets. Sadly I need to make sure you are human.
2 + 1 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.