PHP XML lib similar to SimpleXML?

Soldato
Joined
26 Dec 2003
Posts
16,522
Location
London
Does anyone know of any decent XML (un)serialization libraries out there that work like SimpleXML but... aren't SimpleXML? I'm having a hard time tracking down anything remotely decent, and I really don't want to have to write my own.

Things I'm looking for:

  • PHP 5 and 4 compatability. Definitely not either-or. This casts out Keith Devens' library, which is a shame because otherwise it's quite nice.
  • Object unserialization if possible, a la SimpleXML - if only because $foo->bar->lol is easier to both read and write than $foo['bar']['lol'].
  • Portability - if possible, just a single include - this throws out PEAR XML_(Un)serialize, since they require loads of PEAR stuff to be installed which I can't rely on.

Anyone know of anything good? It seems like it would be the easiest thing in the world to do but nobody seems to want to write it :(
 
I've had a look at all the ones I heard of, and they either use the $foo['bar']['lol'] structure, or are PHP5 only.

Have you tried writing a recursive function to convert from array to object? And would that be acceptable if you did have it?
 
If I could find a decent one that unserialized to an array, I'd either live with that or write the conversion, but as it is I can't even find that :(
 
Back
Top Bottom