Note that this is a long-standing problem with xmllint and even the latest version has the same problems. Sometimes the error is correct ('did not expect to see element 'bar'), but only because a previous error was not reported (because 'bar' was supposed to be following the required but missing element 'foo', but xmllint doesn't tell us that bit).
It doesn't give false positives or negatives, but if the document fails to validate, xmllint will often report the wrong element or attribute for a given error. xmllint routinely has issues in reporting validation errors incorrectly. Then we do the actual validation via xmllint. We use the compact RelaxNG format and trang to convert it to the standard RelaxNG format. We have a large Perl system which uses RelaxNG to validate our XML. Why not xmllint? (This is background and you can skip it if you like) * Can easily integrate with Perl (this is optional, but it would be nice) Which XML validation tools can you recommend for both performance and accuracy, each of which is a critical issue on our system? We have the following requirements: Java -classpath ~/Software/saxon9/saxon9sa.jar -xsd:test.xsd -s:test.xml