i-complex/xsd-reader

Read any XML Schema (XSD) programmatically with PHP

0.1.0 2024-04-11 03:57 UTC

This package is not auto-updated.

Last update: 2024-11-22 05:12:14 UTC


README

Build Status Code Coverage Scrutinizer Code Quality

PHP XSD Reader

Read any XML Schema (XSD) programmatically with PHP.

Installation

The recommended way to install the xsd-reader via Composer:

composer require 'goetas-webservices/xsd-reader'

Getting started

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){

}

Note

The code in this project is provided under the MIT license. For professional support contact goetas@gmail.com or visit https://www.goetas.com