PHPackages                             vdhicts/xml-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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. vdhicts/xml-validator

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

vdhicts/xml-validator
=====================

Validate your XML easily to a XSD schema

v3.0.0(2mo ago)218.6k↓39.8%1MITPHPPHP ^8.2CI passing

Since Jun 26Pushed 2mo agoCompare

[ Source](https://github.com/vdhicts/xml-validator)[ Packagist](https://packagist.org/packages/vdhicts/xml-validator)[ RSS](/packages/vdhicts-xml-validator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (5)Versions (6)Used By (0)

XML Validator
=============

[](#xml-validator)

Validate your XML easily. The main purpose is to validate the XML to a XSD schema, but (basic) validation without a schema is possible too.

```
$validator = new Validator();

// Validate with a XSD schema
$result = $validator->validate('books.xml', 'books.xsd');

// Or validate without a XSD schema
$result = $validator->validate('books.xml');

// Retrieve any errors
if (!$result->isValid()) {
    $errors = $result->getErrors();
}
```

Requirements
------------

[](#requirements)

This package requires PHP 8.2 or higher with the libxml extension (which is enabled by default).

Installation
------------

[](#installation)

```
composer require vdhicts/xml-validator
```

Tests
-----

[](#tests)

Full code coverage unit tests are available in the `tests` folder. Run via phpunit:

`vendor\bin\phpunit`

By default a coverage report will be generated in the `build/coverage` folder.

Contribution
------------

[](#contribution)

Any contribution is welcome, but it should be fully tested, meet the PSR-2 standard and please create one pull request per feature. In exchange you will be credited as contributor on this page.

Security
--------

[](#security)

If you discover any security related issues in this or other packages of Vdhicts, please email instead of using the issue tracker.

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

About vdhicts
-------------

[](#about-vdhicts)

[Vdhicts](https://www.vdhicts.nl) is the name of my personal company. Vdhicts develops and implements IT solutions for businesses and educational institutions.

###  Health Score

56

—

FairBetter than 98% of packages

Maintenance88

Actively maintained with recent releases

Popularity30

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 95% 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 ~940 days

Total

4

Last Release

61d ago

Major Versions

1.0.0 → 2.0.02021-09-14

2.1.0 → v3.0.02026-03-18

PHP version history (4 changes)1.0.0PHP ^7.1

2.0.0PHP ^7.4

2.1.0PHP ^7.4|^8.0

v3.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/88d23e7b707d1cfe0eea91c00590613f45e0c75cb0a3ce89354328332e5c0c02?d=identicon)[vdhicts](/maintainers/vdhicts)

---

Top Contributors

[![dvdheiden](https://avatars.githubusercontent.com/u/90568118?v=4)](https://github.com/dvdheiden "dvdheiden (19 commits)")[![soukicz](https://avatars.githubusercontent.com/u/1814750?v=4)](https://github.com/soukicz "soukicz (1 commits)")

---

Tags

phpvalidationxmlxsd

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Code StyleECS

Type Coverage Yes

### Embed Badge

![Health badge](/badges/vdhicts-xml-validator/health.svg)

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

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)

PHPackages © 2026

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