【问题标题】:Mismatch in Namespaces in xml and xsdxml 和 xsd 中的命名空间不匹配
【发布时间】:2017-07-19 00:45:35
【问题描述】:

我有一个服务的 xsd 文件,其中命名空间在顶层定义为 -

<xs:schema 
xmlns:xs="http://www.w3.org/2001/XMLSchema" 
targetNamespace= "http://www.ycompany.net/" 
xmlns="http://www.ycompany.net/" 
elementFormDefault="qualified">

然后整个xsd中就没有命名空间了。

但是如果我看到这个服务的 XML 响应,参数的名称是正确的,但是每个元素都有完全不同的命名空间。例如

<a:getScooterListResponse xmlns:a="http://com/ngr/pumba/vip/service/ycompany/grammars/pclst" xmlns:b="java:ycompany.grammars.pclst.structures.messages" xmlns:c="java:ycompany.grammars.pclst.structures.groups" xmlns:d="java:ycompany.grammars.pclst.structures.segments" xmlns:e="java:ycompany.grammars.pclst.structures.composites" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <a:return>
        <b:OrFiltersQuery>
            <c:Dummy>
                <d:DummyByte>0</d:DummyByte>
            </c:Dummy>
            <c:AndFiltersQuery>
                <c:ScooterListFilterName>
                    <d:AttributeDetails>
                        <e:AttributeType>FQA</e:AttributeType>
                    </d:AttributeDetails>
                </c:ScooterListFilterName>
            </c:AndFiltersQuery>
        </b:OrFiltersQuery>
.
.
.

我的问题是,是否有可能在 xsd 和实际响应中有不同的命名空间,或者这个 xml 是否用于不同的 xsd?

【问题讨论】:

标签: xml xsd xml-namespaces


【解决方案1】:

您没有向我们展示整个架构(架构文档可能会为不同的命名空间导入其他架构文档),但从您向我们展示的内容来看,这不是该实例文档的正确架构。

【讨论】:

    猜你喜欢
    • 2020-10-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-10-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多