generate PHP classes from XSD?

Qwerty picture Qwerty · Feb 15, 2010 · Viewed 38.8k times · Source

Is there in the world analogues of JavaBeans or JAXB for PHP? Is it possible to generate PHP classes from XML schema?

It's common practice to publish API's as XSD schemas. Java and C# guys can get advantage of this by generating classes right from XSD. Is there same tool for PHP?

Answer

Mike Bevz picture Mike Bevz · Jul 20, 2010

I'm working now on this issue and going to release the tool as soon as it reaches more-less stable state. Check here http://mikebevz.com/xsd-to-php-tool/

Upd. I've just release first working prototype, it works fine with UBL 2.0 schemas and one simple schema, but more serious testing is on the way. I'd appreciate if you send schemas you're working with, so I'd include them in the test suite.

Upd. 2. XSD2PHP reached version 0.0.5. Check the progress on https://github.com/moyarada/XSD-to-PHP