i-complex/xsd-reader

使用 PHP 编程方式读取任何 XML Schema (XSD)

0.1.0 2024-04-11 03:57 UTC

This package is not auto-updated.

Last update: 2024-09-27 04:16:09 UTC


README

Build Status Code Coverage Scrutinizer Code Quality

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