generate PHP classes from XSD?

后端 未结 8 2130
春和景丽
春和景丽 2020-12-05 07:41

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

相关标签:
8条回答
  • 2020-12-05 08:06

    The DMS Software Reengineering Toolkit is configurable code generation machinery, that can be used to process arbitrary formal documents as input. DMS can be used to generate code in arbitary output languages.

    We have used it to generate native Java and COBOL XML readers and writers from DTDs, which are the elder cousin of schemas. The same ideas would be easily applied to PHP.

    0 讨论(0)
  • 2020-12-05 08:18

    This library seems to be the best choice nowadays: https://github.com/goetas/xsd2php

    It generates PHP classes for XML Elements and can convert it back and forth:

    XML -> PHP -> XML

    0 讨论(0)
提交回复
热议问题