我有一个用于服务的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和实际响应中使用不同的名称空间,或者这是用于不同xsd的xml吗?
发布于 2017-07-19 00:45:35
您还没有向我们展示整个模式(模式文档可能会为不同的名称空间导入其他模式文档),但是从您向我们展示的内容来看,这不是这个实例文档的正确模式。
https://stackoverflow.com/questions/45171447
复制相似问题