PHPackages                             ottosmops/xmlvalidator - 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. ottosmops/xmlvalidator

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

ottosmops/xmlvalidator
======================

Validate XML-Files, also parts

v1.7.0(2y ago)1142MITXSLTPHP &gt;=8.1.0CI failing

Since Oct 7Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ottosmops/xmlvalidator)[ Packagist](https://packagist.org/packages/ottosmops/xmlvalidator)[ Docs](https://github.com/ottosmops/validatexml)[ RSS](/packages/ottosmops-xmlvalidator/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (2)Dependencies (2)Versions (8)Used By (0)

Validate XML or XML-parts against a Schema, RelaxNG or an XSL (Schematron)
==========================================================================

[](#validate-xml-or-xml-parts-against-a-schema-relaxng-or-an-xsl-schematron)

[![Software License](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Tests](https://github.com/ottosmops/xmlvalidator/actions/workflows/run-tests.yml/badge.svg)](https://github.com/ottosmops/xmlvalidator/actions/workflows/run-tests.yml/badge.svg)[![Packagist Downloads](https://camo.githubusercontent.com/4f56579e679868c58fddb01a5f5d45fe40a03da8cee32d894ff525b4aafc1c0c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f74746f736d6f70732f586d6c56616c696461746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ottosmops/xmlvalidator)

This package was developed to validate Mets files for the [DFG-Viewer](http://www.dfg-viewer.de). It is possible to validate only parts of a xml-file. Validation is possible with `xsd`, `rng` and `xsl` (Schematron). To validate only parts of an XML file, specify the root element of that part. In the tests folder is a copy of [dmj/dfgviewer-schema](https://github.com/dmj/dfgviewer-schema).

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

[](#installation)

```
composer require ottosmops/xmlvalidator
```

Usage
-----

[](#usage)

There is the one and only method `validate`:

```
