RelaxNG 与 XML 模式 [英] RelaxNG vs XML Schema

查看:21
本文介绍了RelaxNG 与 XML 模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目,我使用 RelaxNG (jing) 进行验证xml.我喜欢 RelaxNG 的语法,但是我使用的大多数工具都可以使用 XML 模式(实际上,我认为除了 jing 之外,我没有其他工具可以这样做).当大多数支持似乎围绕 XML 模式时,我是否通过使用 RelaxNG 犯了设计和未来支持错误?我是否应该坚持使用 RelaxNG 并让其他人学习它(必要时踢和尖叫,j/k)?由于工具支持,我应该切换到 xml schema 吗?

I have a project where I'm using RelaxNG (jing) to validate xml. I like the syntax for RelaxNG, but most of the tools that I have work with XML schema (actually, I don't think I have a tool that does, other than jing). Am I making a design and future support mistake by using RelaxNG when most of the support seems to be around XML schema? Should I just stick with RelaxNG and make everyone else learn it (kicking and screaming if necessary, j/k)? Should I switch to xml schema because of tool support?

谢谢.

推荐答案

答案有点陈词滥调:视情况而定.

The answers is a bit cliche: it depends.

你可能会问什么?在您的用户可能会使用的工具上.如果你依赖你的用户,如果缺乏好的工具会把他们赶走,你可能会失去他们.根据我的经验,由于 XML 模式使用非常广泛,因此您可能需要重新考虑继续使用 Relax NG 的决定.它比 XML 模式更好、更容易理解,但这并不意味着它会使您的项目成功.

On what, you might ask? On tools that your users will probably be using. And if you depend on your users, you might lose them if lack of good tools will drive them away. Since XML schema is, from my experience, very widely used, you might want to reconsider your decision on going forward with Relax NG. It is nicer and more easily understood than XML schema, but that doesn't mean it will make your project successful.

如果您想冒险一点,请继续使用Relax NG.在开发的每一步中,尝试使用像 Trang.以防万一有一天您决定放松 NG 不值得,而且您知道您有一个合理的备份.

If you want to risk a bit, go ahead using Relax NG. And during every step of your development, try converting Relax NG to XML schema using a tool like Trang. Just in case you decide one day that Relax NG isn't worth it and you know you have a reasonable backup.

这篇关于RelaxNG 与 XML 模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆