Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我从需要处理的服务中获取此 XML。我对 XML Schema 或 Namespace 不太感兴趣,但对我来说它看起来很乱。有人可以看看它并告诉我如何使它更好吗?
http://gist.github.com/325952
我知道命名空间定义可以在第一行声明,而不是在每一行。还有什么可以清理的吗?
我会说:将前两个元素保留为 xsd 前缀:它仅出现在最外层的两个元素中。此外,xmlns="http://com/acmephone/ovm/cas/types"在根处声明并typ:从所有内容中删除前缀。
xmlns="http://com/acmephone/ovm/cas/types"
typ:
编辑:实际上将 xsd 前缀更改为其他前缀;这无关紧要,但使用通常绑定到 XML 模式名称空间的前缀似乎只会引起混淆。