How to use an XSD schema in php
The PHP DOM extension, which is available almost all the time can do this natively.
$dom = new DomDocument;
$dom->loadXML($contentOfResponse);
if ($dom->schemaValidate('path/to/schema.xsd')) {
// Valid response from service
} else {
// Invalid response
}
Of course, you can also load the document to validate from a file.Documentation: http://ca.php.net/manual/en/domdocument.schemavalidate.php
Generate Java classes from .XSD files...?
JAXB does EXACTLY what you want. It's built into the JRE/JDK starting at 1.6
Related Topics
PHP Pdo Bindparam Was Falling in a Foreach
Reverse Letters in Each Word of a String Without Using Native Splitting or Reversing Functions
Denormalize Nested Structure in Objects with Symfony 2 Serializer
Visits Counter Without Database with PHP
Does HTML_Entity_Decode Replaces &Nbsp; Also? If Not How to Replace It
PHP Dynamically Create CSV: Skip the First Line of a CSV File
Docx File Type in PHP Finfo_File Is Application/Zip
Ffmpeg Mamp "Dyld: Library Not Loaded" Error
PHP Flush() Not Working in Chrome
Customizing My-Account Addresses Fields in Woocommerce 3
Remove Namespace from Xml Using PHP
How to Make a Chat Room Script with PHP
Are There Any PHP Docblock Parser Tools Available
Checking If String Contains "Http://"
Difference Between Buffered and Unbuffered Queries
PHP Local Server Invalid Request (Unexpected Eof)
How to Remove All Dtddwrappers and Labels on Zend Form Elements