如何避免 XML 模式中的复杂类型

发布于 2024-10-04 02:32:58 字数 141 浏览 0 评论 0原文

它在这里说( http://www.xml.com/lpt/a/798 )您应该避免在 XML 模式中使用复杂类型。如何在没有复杂类型的情况下使用属性?

It says here ( http://www.xml.com/lpt/a/798 ) that you should avoid using complexTypes in XML Schema. How to I use Attributes without complex types?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

冬天旳寂寞 2024-10-11 02:32:58

您链接到的文章具有误导性。我认为它建议您不要使用命名(顶级)复杂类型。但如果您想使用属性,您仍然必须使用complexTypes(在元素声明内)(文章说:“将其视为占位符”)。我个人认为命名的复杂类型没有任何问题,但确实不需要它们以 XML 模式开始。

The article you link to is misleading. I think it advises you to not use named (top-level) complexTypes. But you still have to use complexTypes (within an element declaration) if you want to use attributes (the article says: "consider this as a place holder"). Personally I think there's nothing wrong with named complexTypes, but it's true you don't need them to start with XML schemas.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文