bretto36 / xsd-reader

Pure PHP XSD Reader (XML Schema)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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-webservices/xsd-reader'
  • adding the dependency to your composer.json file:
"require": {
    ..
    "goetas-webservices/xsd-reader" : "0.*",
    ..
}

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

}

About

Pure PHP XSD Reader (XML Schema)


Languages

Language:PHP 100.0%