我应该使用 XSD 1.1 来构建开放标准吗? [英] Should I be using XSD 1.1 to build an open standard?

查看:32
本文介绍了我应该使用 XSD 1.1 来构建开放标准吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们被要求为开放的 XML 标准组合一组模式.

We have been asked to put together a set of schemas for an open XML standard.

XSD 1.0 可以处理大部分规则,但在某些地方会有点混乱(特别是为了允许可扩展性),它还依赖于实现者以注释的形式阅读一些规则的自由文本描述.

XSD 1.0 would cope with most of the rules, but it would be a bit messy in places (especially to allow for extensibility) it would also rely on implementers reading free text descriptions of some rules in the form of annotations.

几乎所有规则都可以使用 XSD 1.1 实现,但是我们不确定这是否会过度限制实现者.

Pretty much all of the rules could be implemented using XSD 1.1, however we are not sure if this would limit implementers unduly.

所以我的问题是,XSD 1.1 是否成熟到可以在野外使用?

So my question, is XSD 1.1 mature enough to be used in the wild?

推荐答案

使用 XSD 1.0 的原因

  • 限制最少的要求论证:通过要求最低公分母标准 XSD 1.0 来最大限度地提高系统和团队之间的互操作性.
  • 更广泛的工具和库支持:JAXB 和 xsd.exe(.NET),例如,仍然不支持 XSD 1.1.
    • Assertions (xs:assert) are wonderfully powerful. Leverages XPath to provide flexible mechanism to express constraints beyond core content and type modeling.
    • Conditional Type Assignment can be useful when type should vary per attribute value.
    • Many other improvements. See W3C XML Schema Definition Language (XSD) 1.1 Part 1: Structures, Appendix G Changes since version 1.0 (non-normative)

    如果参与构建和交互系统的所有各方都准备迁移到 XSD 1.1,并且不依赖于仅支持 XSD 1.0 的工具或库,那么迁移到 XSD 1.1.否则,请坚持使用 XSD 1.0.

    If all parties involved with building and interacting your system are prepared to move to XSD 1.1 and have no dependencies on tools or libraries that only support XSD 1.0, then move to XSD 1.1. Otherwise, stick with XSD 1.0.

    这篇关于我应该使用 XSD 1.1 来构建开放标准吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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