5

Is there a framework like JAXB for PHP?

I need a framework that, as JAXB, create a XML file from an object. This framework has to know how to map the object to XML, respecting its structure when needed (children objects, lists, etc.).

Also, it needs to do the reverse engineering, which means convert a (valid) XML file to the origin object.

In other words, the framework must be able to marshal an object and unmarshal a XML file.

I know how great is JAXB and it's really bad that I can't use Java in this project I'm currently working.

  • PHP is not that powerful. You are going to have to look at SimpleXML to do that. – xaav Nov 23 '10 at 03:23
  • Is the usual Serialization not an option? – KingCrunch Nov 24 '10 at 01:51
  • Most of the comments leads to serialization. Not a bad option, but not exactly what I need. SimpleXML will help a lot, for sure. Still, something closer to JAXP would be great. Thanks for all the comments. If I create something (PAXP), I'll let you know. – William Brombal Chinelato Nov 24 '10 at 23:50
  • The solution to this problem was to integrate PHP with Java, using Quercus. The integration is pretty easy and the whole Java API for XML works perfectly on PHP. – William Brombal Chinelato Feb 14 '11 at 18:10

2 Answers2

1

I think you're looking for an PHP object XML serializer/deserializer. This might help: PHP Object as XML Document

Community
  • 1
  • 1
alexantd
  • 3,543
  • 3
  • 27
  • 41
0

JSMX is an Ultra Lightweight - Language Agnostic - Ajax Framework. It is by far the easiest way to integrate Ajax into any Web Application. What separates JSMX from most other Ajax Frameworks is that the JSMX API runs entirely on the client and has no Server Side Components to install. Given this fact plus the fact that you can pass back JavaScript, XML, JSON, or WDDX makes JSMX a truly Universal Ajax API. link text