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:
I think that JDrago has the right idea, that you need to avoid libxml2-based tools for RNG validation, at least for now. I'm discovering this as well in my project. I recently logged two bugs against libxml2 concerning RNG validation.
I recommend jing. It was written by James Clark, the creator of Relax NG and one of the leading lights in the XML world. He is also the author of trang, which you are already using. Development of this code (and of trang) recently resumed at the Google Code site I link to above.
Jing has proved consistently correct with our content and schema, and to give much better error messages than libxml2, though there is still a lot of room for improvement in that regard.
The one shortcoming of jing vis a vis libxml2/xmllint is that it doesn't at present use OASIS XML catalogs to resolve public and system identifiers and URIs pointing to schemas. This would be an issue in case you have included schemas that are referred to by 'http' URI--those would always be fetched over the network.
Hamcrest Schema allows you to validate XML documents against RelaxNG using Hamcrest Matchers.
rnv is very fast, free (as in free speech) and runs on the command line (so Perl can invoke it easily). Most of the times, the messages are OK. Unfortunately, it seems no longer maintained.
i am the author of RNV. It is maintained on sourceforge.net, and there is a maintainer who takes care of both sourceforge and debian package builts. The fact is that the code is not changed is due to the code being stable. There are no bugs reported.
I suspect xmllint uses the same underlying libraries (libxml2, etc) as anything else. It is counterintuitive to think that another front-end to the same library would give different results.