以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 DTD/XML Schema 』  (http://bbs.xml.org.cn/list.asp?boardid=23)
----  关于sequence、choice、all的问题  (http://bbs.xml.org.cn/dispbbs.asp?boardid=23&rootid=&id=50879)


--  作者:thinktodo
--  发布时间:8/2/2007 4:25:00 PM

--  关于sequence、choice、all的问题

下面是我定义的一个schema,我不确定这样的格式是否正确
<complexType>
<sequence>
  <all>
   <element name="a" type="string">
   <element name="b" type="anyType">
  </all>
  <choice>
   <element name="c" type="string">
   <element name="d" type="anyType">
  </choice>
  <sequence>
   <element name="e" type="string">
   <element name="f" type="anyType">
  </sequence>
</sequence>
</complexType>


<complexType>
<sequence>
  <all>
  </all>
  <choice>
  </choice>
  <sequence>
  </sequence>
</sequence>
</complexType>
还是

<complexType>

  <all>
  </all>
  <choice>
  </choice>
  <sequence>
  </sequence>

</complexType>


--  作者:thinktodo
--  发布时间:8/2/2007 4:38:00 PM

--  
哦,是我搞错了,只要有<all>就不能出现<sequence>或<choice>了
--  作者:thinktodo
--  发布时间:8/2/2007 4:46:00 PM

--  
应该是
<sequence>
<choice>
</choice>
<!--声明其他元素-->
</sequence>

或者

<sequence>
<all>
</all>
<!--声明其他元素-->
</sequence>
对吧?高手帮忙鉴定一下


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