XML Schema Validation with RelaxNG

ⅰ亾dé卋堺 提交于 2019-12-03 01:51:08

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.

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!