XSD名称空间问题

时间:2015-01-15 12:21:07

标签: xml xsd

我想修改我的XSD以适应相应的XML文件(Test_1.xml)。这里的要点是,在XML中,我遇到一个属性(属性的名称是"类型"),xsi命名空间 ...但我不知道知道如何为模式定义中的属性单独指定命名空间

代码提取:

<ns:return xsi:type="ax261:StatisticsReturnWS"
           xmlns:ax259="http://ws.transverse.ese.esepa.soprabanking.com/xsd"
           xmlns:ax263="http://error.transverse.ese.esepa.soprabanking.com/xsd"
           xmlns:ax262="http://retour.socle.ws.ese.esepa.soprabanking.com/xsd"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:ax261="http://retour.ws.ese.esepa.soprabanking.com/xsd">
  <ax262:returnCode>0</ax262:returnCode>
  <ax261:statisticMessageWS **xsi:type="ax261:StatisticMessageWS"**>

1 个答案:

答案 0 :(得分:1)

xsi:type属性不需要在模式中显式声明:它是隐式声明的,并且允许每个元素。

如果是某些其他命名空间属性,例如xlink:href或xml:id,然后您需要为相关命名空间(xlink或xml)创建(或获取)模式文档,确保它包含此属性的全局属性声明,将该模式文档导入到您的& #34;主&#34;模式文档,将前缀绑定到相关的名称空间URI,然后引用复杂类型定义中的属性,例如如

<xs:attribute ref="xlink:href"/>
相关问题