turnerlabs / validating-xml-encoder
A XML Encoder that validates the result against an XSD.
Installs: 8 507
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 6
Forks: 1
Open Issues: 0
Requires
- php: ^5.6 || ^7.0
- symfony/serializer: ^2.8 || ^3.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.4
- mikey179/vfsstream: ^1.6
- phpunit/phpunit: ^5.7
This package is not auto-updated.
Last update: 2021-09-09 12:09:41 UTC
README
This is a XML encoder that validates the result against an XSD. Works well with the Symfony Serialization Component and the Drupal Serializer.
<?php $encoder = new \TurnerLabs\ValidatingXmlEncoder\Encoder('rootNodeName', $pathToXsd)); // If the encoded result of $data is not valid according to the XSD, // \TurnerLabs\ValidatingXmlEncoder\Exception\XsdValidationException is thrown. $xml = $encoder->encode($data);