View on GitHub

Xsd-reader

Read XSD into PHP

Download this project as a .zip file Download this project as a tar.gz file

Build Status Code Coverage Scrutinizer Code Quality

PHP XSD Reader

Read any XML Schema (XSD) programmatically with PHP.

Installation

There are two recommended ways to install the xsd-reader via Composer:

composer require 'goetas/xsd-reader:1.*'
"require": {
    ..
    "goetas/xsd-reader" : "1.*",
    ..
}

Getting started

use Goetas\XML\XSDReader\SchemaReader;

$reader = new SchemaReader();
$schema = $reader->readFile("http://www.example.com/exaple.xsd");

// $schema is instance of Goetas\XML\XSDReader\Schema\Schema;

// Now you can navigate the entire schema structure

foreach ($schema->getSchema() 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){

}


API Documentation

Read the API Documentation:

Note

I'm sorry for the terrible english fluency used inside the documentation, I'm trying to improve it. Pull Requests are welcome.