XSD validation error messages suck
shrink0r opened this issue · 2 comments
If the xsd schema validation fails, the error message that is raised, does not help much in finding the invalid spot.
Also if the schema file that is loaded is invalid there is no convenient error handling atm.
What could be a good way to give detailed feedback on why the schema validation failed?
Find out and implement!
Yeh i also had a problem with this... let's see what we can do
I had a look at this and it seems that if the schema is invalid, DOMDocument::schemaValidate()
generates a warning which PHPUnit is converting to an exception at https://github.com/shrink0r/workflux/blob/master/src/Parser/Xml/AbstractXmlParser.php#L142-L144. If you suppress the warning, the consequent Workflux\Error\Error
exception doesn't distinguish between an XML validation error or a XSD validation error, nor does it give useful feedback.
Let me know if my attempt at a solution is useful.