如何避免 XML 模式中的复杂类型
它在这里说( 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您链接到的文章具有误导性。我认为它建议您不要使用命名(顶级)复杂类型。但如果您想使用属性,您仍然必须使用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.