Validating xml against xsd net
In my experience, the errors are returned by libxml_get_errors in descending severity, so this may be an OK thing to do.In older versions of PHP5 this function might cause error messages when dealing with namespaces.I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing.
DOM obviously has some namespace problems with documents, that have been created manually (i.e. So my workaround is saving the DOMDocument temporarily, re-loading it and then validating the temporary DOMDocument.
It's supplied by Microsoft, so it isn't something I created.
Could it be that the structure of the XSD file only allows for the return of the first error?
A note for people trying to validate complex schemas with PHP.
It seems that libxml will not automatically try to import referenced schemas, but simply skip the validation if the schemas were not explicitly imported.
I am trying to validate XML files using an XSD file. NET code examples on the web, but many use deprecated . The code I'm currently using (which may be old and in need of updates) throws an error whenever there is any variation or problem in the XML file.