以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 DTD/XML Schema 』  (http://bbs.xml.org.cn/list.asp?boardid=23)
----  Extension和All如何结合使用?谢谢!  (http://bbs.xml.org.cn/dispbbs.asp?boardid=23&rootid=&id=26303)


--  作者:waynezhu
--  发布时间:1/10/2006 1:32:00 PM

--  Extension和All如何结合使用?谢谢!
NotifyClearedAlarm继承Notification,再增加一个Element:Body,但原来Notification中用了All,且不想修改它,现在NotifyClearedAlarm中是否还可以用All?不能用的话可以用什么方法生成NotifyClearedAlarm,使其包含继承的header和新增的body?是否可以不用Extension改用其它的什么?谢谢!


<complexType name="Notification">
  <all>
   <element name="header" type="xe:NotificationHeader"/>
  </all>
</complexType>

<complexType name="NotifyClearedAlarm">
  <complexContent>
   <extension base="xe:Notification">
    <all>
     <element name="body">
      <complexType>
       <sequence>
        <element ref="xa:probableCause"/>
        <element ref="xa:alarmType"/>
        <element ref="xa:alarmID"/>
       </sequence>
      </complexType>
     </element>
    </all>
   </extension>
  </complexContent>
</complexType>


W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
31.250ms