Skip to content

das-peter/xsd-reader

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

  • using the composer require command:
composer require 'goetas/xsd-reader:2.*'
  • adding the dependency to your composer.json file:
"require": {
    ..
    "goetas/xsd-reader" : "2.*",
    ..
}

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

}

Note

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

Packages

No packages published

Languages

  • PHP 100.0%