PHPackages                             greenter/ubl-validator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. greenter/ubl-validator

ActiveLibrary[Payment Processing](/categories/payments)

greenter/ubl-validator
======================

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

v2.2.0(3y ago)15180.9k↓12.9%129MITPHPPHP &gt;=5.5.9CI failing

Since Jan 25Pushed 3y ago3 watchersCompare

[ Source](https://github.com/thegreenter/ubl-validator)[ Packagist](https://packagist.org/packages/greenter/ubl-validator)[ Docs](https://github.com/thegreenter/ubl-validator)[ RSS](/packages/greenter-ubl-validator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (1)Versions (9)Used By (9)

OASIS UBL Schema Validator
==========================

[](#oasis-ubl-schema-validator)

[![Github Actions](https://github.com/thegreenter/ubl-validator/workflows/CI/badge.svg)](https://github.com/thegreenter/ubl-validator/actions)[![Coverage Status](https://camo.githubusercontent.com/c39efdfea3f69cd37180d7c6049f158f74c170cd14ef6928368913fca63ae0b8/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f746865677265656e7465722f75626c2d76616c696461746f722e7376673f6c6162656c3d636f766572616765267374796c653d666c61742d737175617265266272616e63683d6d6173746572)](https://coveralls.io/github/thegreenter/ubl-validator?branch=master)[![Codacy Badge](https://camo.githubusercontent.com/172e01a449da4d142f258be853c5c03315893c18ad0dca2b680475e8f44c4018/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f6239326439656138303266643433306661326334383935666632636430346537)](https://www.codacy.com/gh/thegreenter/ubl-validator?utm_source=github.com&utm_medium=referral&utm_content=thegreenter/ubl-validator&utm_campaign=Badge_Grade)[![Mutation Badge](https://camo.githubusercontent.com/f28be4946be571a4b8f05c1655e1dceae707243824de53ab7e52be1235fdcee6/68747470733a2f2f62616467652e737472796b65722d6d757461746f722e696f2f6769746875622e636f6d2f746865677265656e7465722f75626c2d76616c696461746f722f6d6173746572)](https://camo.githubusercontent.com/f28be4946be571a4b8f05c1655e1dceae707243824de53ab7e52be1235fdcee6/68747470733a2f2f62616467652e737472796b65722d6d757461746f722e696f2f6769746875622e636f6d2f746865677265656e7465722f75626c2d76616c696461746f722f6d6173746572)
[OASIS](https://www.oasis-open.org/committees/ubl/) Universal Business Language (UBL) Schema Validator.

Install
-------

[](#install)

Via Composer from [packagist.org](https://packagist.org/packages/greenter/ubl-validator).

```
composer require greenter/ubl-validator
```

Examples
--------

[](#examples)

Simple usage.

```
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:

- Resolve ``
- Find `XSD` file in [base directory](https://github.com/thegreenter/ubl-validator/tree/master/src/xsd)
- Run `schemaValidate` and gets result

### Change UBL XSD directory

[](#change-ubl-xsd-directory)

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

```
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('');
```

`/my-ubl-xsd` directory follows this structure:

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

```

> You can download UBL xsd from [oasis-open](https://docs.oasis-open.org/ubl/)

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity43

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~298 days

Recently: every ~379 days

Total

7

Last Release

1246d ago

Major Versions

v1.1.0 → v2.0.02018-10-25

### Community

Maintainers

![](https://www.gravatar.com/avatar/fe086524f65d72195ad5dfd938bcd0b06349581b48ec60c56c5ba654167c8f55?d=identicon)[giansalex](/maintainers/giansalex)

---

Top Contributors

[![giansalex](https://avatars.githubusercontent.com/u/14926587?v=4)](https://github.com/giansalex "giansalex (79 commits)")

---

Tags

greenterinvoiceoasisphpsunatublubl-validatorubl20ubl21validatorvalidatorinvoiceublgreenter

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/greenter-ubl-validator/health.svg)

```
[![Health](https://phpackages.com/badges/greenter-ubl-validator/health.svg)](https://phpackages.com/packages/greenter-ubl-validator)
```

###  Alternatives

[num-num/ubl-invoice

A modern object-oriented PHP library to create and read valid UBL and EN 16931/Peppol BIS 3.0 files

135820.5k](/packages/num-num-ubl-invoice)[horstoeko/zugferd

A library for creating and reading european electronic invoices

4174.3M18](/packages/horstoeko-zugferd)[josemmo/einvoicing

Library for reading and creating European-compliant electronic invoices (EN 16931)

173279.6k2](/packages/josemmo-einvoicing)[cleverit/ubl_invoice

A PHP wrapper for UBL invoices

36283.4k](/packages/cleverit-ubl-invoice)[payum/offline

The Payum extension. It provides Offline payment integration.

323.4M13](/packages/payum-offline)[horstoeko/zugferdublbridge

Convert Factur-X/ZUGFeRD (CII-Syntax) to PEPPOL (UBL-Syntax) and visa versa

16135.6k5](/packages/horstoeko-zugferdublbridge)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
