turnerlabs/validating-xml-encoder

This package is abandoned and no longer maintained. No replacement package was suggested.

A XML Encoder that validates the result against an XSD.

0.3 2017-10-05 15:30 UTC

This package is not auto-updated.

Last update: 2021-09-09 12:09:41 UTC


README

CircleCI

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);