Skip to content

Commit

Permalink
update code example
Browse files Browse the repository at this point in the history
  • Loading branch information
giansalex committed Oct 23, 2018
1 parent 3ba15f0 commit f0f898a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Travis-CI](https://img.shields.io/travis/giansalex/ubl-validator.svg?branch=master&style=flat-square)](https://travis-ci.org/giansalex/ubl-validator)
[![Coverage Status](https://img.shields.io/coveralls/giansalex/ubl-validator.svg?label=coverage&style=flat-square&branch=master)](https://coveralls.io/github/giansalex/ubl-validator?branch=master)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/c911fe005e73428591aa13b966bc488a)](https://www.codacy.com/app/giansalex/ubl-validator?utm_source=github.com&utm_medium=referral&utm_content=giansalex/ubl-validator&utm_campaign=Badge_Grade)
OASIS Universal Business Language Schema Validator - SUNAT.
OASIS Universal Business Language Schema Validator, SUNAT - Perú.

## Install
Via Composer from [packagist.org](https://packagist.org/packages/greenter/ubl-validator).
Expand All @@ -13,12 +13,16 @@ composer require greenter/ubl-validator

## Example
```php
use Greenter\Ubl\Resolver\UblVersionResolver;
use Greenter\Ubl\SchemaValidator;

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

$validator = new SchemaValidator();
$validator->setVersion('2.0');
$resolver = new UblVersionResolver()
$validator->setVersion($resolver->getVersion($xml));

$xml = file_get_contents('20000000001-01-F001-1.xml');
$result = $validator->validate($xml);

if ($result) {
Expand Down

0 comments on commit f0f898a

Please sign in to comment.