PHPackages                             yzen.dev/validator-xsd - 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. yzen.dev/validator-xsd

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

yzen.dev/validator-xsd
======================

ValidatorXSD is a facade over DOMDocument that will allow you to more conveniently validate your XML file.

0.0.10(3y ago)35.7kMITPHPPHP ^7.4|^8.0

Since Nov 27Pushed 3y ago1 watchersCompare

[ Source](https://github.com/yzen-dev/validator-xsd)[ Packagist](https://packagist.org/packages/yzen.dev/validator-xsd)[ RSS](/packages/yzendev-validator-xsd/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (9)Dependencies (4)Versions (10)Used By (0)

ValidatorXSD is a facade over DOMDocument.
------------------------------------------

[](#validatorxsd-is-a-facade-over-domdocument)

[![Packagist Version](https://camo.githubusercontent.com/3a24074475fc15e727817b8931dedeb31abfb59f530d014fa8206ef91c77462f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f797a656e2e6465762f76616c696461746f722d7873643f636f6c6f723d253233303037656336267374796c653d706c6173746963)](https://camo.githubusercontent.com/3a24074475fc15e727817b8931dedeb31abfb59f530d014fa8206ef91c77462f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f797a656e2e6465762f76616c696461746f722d7873643f636f6c6f723d253233303037656336267374796c653d706c6173746963)[![Packagist Downloads](https://camo.githubusercontent.com/074d61f41f26f62ef9f9249ee60e08bc9def90fc482d5bdcf0dfd9d3531faf8e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f797a656e2e6465762f76616c696461746f722d787364)](https://camo.githubusercontent.com/074d61f41f26f62ef9f9249ee60e08bc9def90fc482d5bdcf0dfd9d3531faf8e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f797a656e2e6465762f76616c696461746f722d787364)[![Packagist Downloads](https://camo.githubusercontent.com/ec47a3b8e189c0857aafc30e72e8ce6f2d62de2fdede97006493ce0c0dd8c57a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f797a656e2e6465762f76616c696461746f722d787364)](https://camo.githubusercontent.com/ec47a3b8e189c0857aafc30e72e8ce6f2d62de2fdede97006493ce0c0dd8c57a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f797a656e2e6465762f76616c696461746f722d787364)

ValidatorXSD is a DOMDocument facade that will allow you to more conveniently validate your XML file and also localize errors.

📜 **Installation**
------------------

[](#scroll-installation)

The package can be installed via composer:

```
composer require yzen.dev/validator-xsd

```

📜 **Features**
--------------

[](#scroll-features)

- Simple use
- Casting LibXMLError errors to ErrorXSD
- Parsing fields, rules and more from an error
- The ability to localize validator errors

📜 **Usage**
-----------

[](#scroll-usage)

Validate xml by schema:

```
    $data = '...';
    $validator = ValidatorXSD::init($data)
                ->loadSchema( './XSD/request.xsd')
                ->setLocalization(CustomLocalizationXSD::class);
    echo $validator->validate();
```

Get all error:

```
    if (!$validator->validate()) {
        foreach ($validator->getErrors() as $error) {
            var_dump($error);
        }
    }
```

Pluck result and group by field:

```
    $errors = $validator->getErrors()
                ->pluck(['element','message'])
                ->groupBy('element');
```

Create custom localization

```
class CustomLocalizationXSD implements LocalizationXSD
{
    public function customAttributes(): array
    {
        return [
            'Country' => 'Страна',
            'Province' => 'Область',
        ];
    }

    public function messages(): array
    {
        return [
            'minLength' => 'Поле "${field}" меньше минимальной длины.',
        ];
    }
}
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 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 ~96 days

Recently: every ~192 days

Total

9

Last Release

1225d ago

PHP version history (2 changes)0.0.1PHP ^7.4

0.0.10PHP ^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/8ca07942b4d955ee72b1bc92220b1bc7686708d0f109ee4abf81f8fbd30732c3?d=identicon)[yzen.dev](/maintainers/yzen.dev)

---

Top Contributors

[![yzen-dev](https://avatars.githubusercontent.com/u/24630195?v=4)](https://github.com/yzen-dev "yzen-dev (4 commits)")

---

Tags

phpvalidationlocalizationxmlxsdshemavalidation xml

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/yzendev-validator-xsd/health.svg)

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

###  Alternatives

[eclipxe/xmlschemavalidator

PHP Library for XML Schema Validations

14300.9k9](/packages/eclipxe-xmlschemavalidator)[yorcreative/laravel-argonaut-dto

Argonaut is a lightweight Data Transfer Object (DTO) package for Laravel that supports nested casting, recursive serialization, and validation out of the box. Ideal for service layers, APIs, and clean architecture workflows.

1062.8k1](/packages/yorcreative-laravel-argonaut-dto)

PHPackages © 2026

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