我们正在为保险领域开发 Web 服务,我们使用 ACORD XML 模式作为标准。 Web 服务正在生成具有命名空间的 ACORD XML,如下所示:
<ns:TXLife><ns:Party></ns:Party></ns:TXLife>
如果命名空间包含在 ACORD XML 中,它是否被视为 ACORD XML?在 ACORD XML 中使用 namespace 有什么好处?
最佳答案
If the namespaces are included in the ACORD XMLs, is it considered ACORD XML?
如果 XML 符合 ACORD XML 模式(即元素的命名空间和排列正确,提供了所需的元素等),那么 XML 就是“ACORD XML”。
您提供的 XML 示例需要定义前缀
ns
引用您正在使用的适当 ACORD 命名空间名称。我假设它在您的完整 XML 中,因为您正在使用自动生成的 Web 服务——但如果没有,则需要添加它。What is the advantage of using namespaces in the ACORD XMLs?
如果没有 ACORD namespace ,则不能将 XML 视为 ACORD XML。请注意,命名空间不一定会将 XML 转换为 ACORD XML,因为它仍然必须符合 ACORD XML 模式。
关于xml - ACORD XML 命名空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12664111/