generate PHP classes from XSD?(从 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 类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:从 XSD 生成 PHP 类?


基础教程推荐
- 在 PHP 中强制下载文件 - 在 Joomla 框架内 2022-01-01
- 通过 PHP SoapClient 请求发送原始 XML 2021-01-01
- WooCommerce 中选定产品类别的自定义产品价格后缀 2021-01-01
- Libpuzzle 索引数百万张图片? 2022-01-01
- XAMPP 服务器不加载 CSS 文件 2022-01-01
- 在多维数组中查找最大值 2021-01-01
- mysqli_insert_id 是否有可能在高流量应用程序中返回 2021-01-01
- 在 Woocommerce 中根据运输方式和付款方式添加费用 2021-01-01
- 如何在 PHP 中的请求之间持久化对象 2022-01-01
- 超薄框架REST服务两次获得输出 2022-01-01