turnerlabs / validating-xml-encoder
该软件包已被废弃,不再维护。未建议替代包。
一个XML编码器,可以验证结果是否符合XSD。
0.3
2017-10-05 15:30 UTC
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
这是一个XML编码器,可以验证结果是否符合XSD。与Symfony 序列化组件和Drupal 序列化API兼容得很好。
<?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);