2017 © Pedro Peláez
 

library ubl-validator

OASIS Universal Business Language Schema Validator UBL v2.0, UBL v2.1

image

greenter/ubl-validator

OASIS Universal Business Language Schema Validator UBL v2.0, UBL v2.1

  • Sunday, March 4, 2018
  • by giansalex
  • Repository
  • 1 Watchers
  • 1 Stars
  • 60 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 3 Versions
  • 20 % Grown

The README.md

OASIS UBL Schema Validator

Github Actions Coverage Status Codacy Badge Mutation Badge
OASIS Universal Business Language (UBL) Schema Validator., (*1)

Install

Via Composer from packagist.org., (*2)

composer require greenter/ubl-validator

Examples

Simple usage., (*3)

use Greenter\Ubl\UblValidator;

$xml = file_get_contents('20000000001-01-F001-1.xml');

$validator = new UblValidator();

if ($validator->isValid($xml)) {
  echo 'Success!!!';
} else {
  echo $validator->getError();
}

Above example follows next steps:, (*4)

  • Resolve <cbc:UBLVersionID>
  • Find XSD file in base directory
  • Run schemaValidate and gets result

Change UBL XSD directory

This package not include all UBL xsd, but you can add others xsd directory and use other UBL version., (*5)

use Greenter\Ubl\UblValidator;
use Greenter\Ubl\Resolver\UblPathResolver;

$ubl = new UblValidator();
$ubl->pathResolver = new UblPathResolver();
$ubl->pathResolver->baseDirectory = './my-ubl-xsd';

echo $ubl->isValid('<Invoice ...>');

/my-ubl-xsd directory follows this structure:, (*6)

\my-ubl-xsd
│
├─2.1/
│   ├─ common/
│   └─ maindoc/
│
├─2.2/
│   ├─ common/
│   └─ maindoc/

You can download UBL xsd from oasis-open, (*7)

The Versions

04/03 2018

dev-master

9999999-dev https://github.com/giansalex/ubl-validator

OASIS Universal Business Language Schema Validator UBL v2.0, UBL v2.1

  Sources   Download

MIT

The Requires

  • php >=5.5.9

 

by Giancarlos Salas

validator ubl facturación electrónica greenter

26/01 2018

v1.0.1

1.0.1.0 https://github.com/giansalex/ubl-validator

OASIS Universal Business Language Schema Validator UBL v2.0, UBL v2.1

  Sources   Download

MIT

The Requires

  • php >=5.5.9

 

The Development Requires

by Giancarlos Salas

validator ubl facturación electrónica greenter

26/01 2018

v1.0.0

1.0.0.0 https://github.com/giansalex/ubl-validator

OASIS Universal Business Language Schema Validator UBL v2.0, UBL v2.1

  Sources   Download

MIT

The Requires

  • php >=5.5.9

 

The Development Requires

by Giancarlos Salas

validator ubl facturación electrónica greenter