i-complex / xsd-reader
使用 PHP 编程方式读取任何 XML Schema (XSD)
0.1.0
2024-04-11 03:57 UTC
Requires
- php: ^7.1|^8.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.10
- phpstan/phpstan: ^0.12
- phpunit/phpunit: ^7.0|^8.0|^9.0
- sebastian/phpcpd: ^4.0|^5.0|^6.0
- vimeo/psalm: ^3.14
This package is not auto-updated.
Last update: 2024-09-27 04:16:09 UTC
README
PHP XSD Reader
使用 PHP 编程方式读取任何 XML Schema (XSD)。
安装
推荐通过 Composer 安装 xsd-reader
composer require 'goetas-webservices/xsd-reader'
入门
use GoetasWebservices\XML\XSDReader\SchemaReader; $reader = new SchemaReader(); $schema = $reader->readFile("http://www.example.com/exaple.xsd"); // $schema is instance of GoetasWebservices\XML\XSDReader\Schema\Schema; // Now you can navigate the entire schema structure foreach ($schema->getSchemas() as $innerSchema){ } foreach ($schema->getTypes() as $type){ } foreach ($schema->getElements() as $element){ } foreach ($schema->getGroups() as $group){ } foreach ($schema->getAttributes() as $attr){ } foreach ($schema->getAttributeGroups() as $attrGroup){ }
注意
此项目的代码在 MIT 许可下提供。如需专业支持,请联系 goetas@gmail.com 或访问 https://www.goetas.com