2017 © Pedro Peláez
 

library xml-validator

A simple PHP XML validator

image

hyperized/xml-validator

A simple PHP XML validator

  • Thursday, June 14, 2018
  • by hyperized
  • Repository
  • 1 Watchers
  • 0 Stars
  • 10 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 25 % Grown

The README.md

hyperized/xml-validator

Buy us a tree Run tests Scrutinizer Code Quality Code Coverage FOSSA Status License, (*1)

A simple PHP XML validator., (*2)

Installation

```shell script composer require hyperized/xml-validator, (*3)


## Usage ```php <?php namespace Hyperized\Xml; require __DIR__ . '/vendor/autoload.php'; $xmlString = file_get_contents(__DIR__ . '/tests/files/correct.xml'); $dirtyXMLString = file_get_contents(__DIR__ . '/tests/files/incorrect.xml'); $xmlFile = __DIR__ . '/tests/files/correct.xml'; $xsdFile = __DIR__ . '/tests/files/simple.xsd'; $validator = new Validator(); // String validation print_r($validator->isXMLStringValid($xmlString)); // 1 print_r($validator->isXMLStringValid($xmlString, $xsdFile)); // 1 // File validation print_r($validator->isXMLFileValid($xmlFile)); // 1 print_r($validator->isXMLFileValid($xmlFile, $xsdFile)); // 1 // Error handling try { $validator->isXMLStringValid($dirtyXMLString, $xsdFile); } catch (Exceptions\InvalidXmlException $exception) { print_r($exception->getMessage()); // xmlParseEntityRef: no name\n The document has no document element. }

Treeware

You're free to use this package, but if it makes it to your production environment you are required to buy the world a tree., (*4)

It’s now common knowledge that one of the best tools to tackle the climate crisis and keep our temperatures from rising above 1.5C is to plant trees. If you support this package and contribute to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats., (*5)

You can buy trees here offset.earth/treeware, (*6)

Read more about Treeware at treeware.earth, (*7)

License

FOSSA Status, (*8)

The Versions

14/06 2018

dev-master

9999999-dev

A simple PHP XML validator

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

by Gerben Geijteman

xml validator