从XSD生成PHP类? [英] generate PHP classes from XSD?

查看:183
本文介绍了从XSD生成PHP类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

世界上是否有JavaBeans或PHP的JAXB的类似物? 是否可以从XML模式生成PHP类?

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

通常的做法是将API发布为XSD模式. Java和C#家伙可以通过直接从XSD生成类来利用此优势.是否有用于PHP的相同工具?

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?

推荐答案

我正在研究此问题,并在达到不太稳定的状态后立即发布该工具.在此处检查 http://mikebevz.com/xsd-to-php-tool/

已更新.我刚刚发布了第一个有效的原型,它可以与UBL 2.0架构和一个简单的架构一起正常工作,但是正在进行更严格的测试.如果您发送正在使用的架构,我们将不胜感激,因此将它们包含在测试套件中.

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.

已更新. 2. XSD2PHP达到了0.0.5版.在 https://github.com/moyarada/XSD-to-PHP 上查看进度

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

这篇关于从XSD生成PHP类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆