Read any XML Schema (XSD) programmatically with PHP.
The recommended way to install the xsd-reader
via Composer:
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){
}
The code in this project is provided under the MIT license. For professional support contact [email protected] or visit https://www.goetas.com