以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 DTD/XML Schema 』  (http://bbs.xml.org.cn/list.asp?boardid=23)
----  在xsd 里到底能不能进行两次complexType 嵌套???/  (http://bbs.xml.org.cn/dispbbs.asp?boardid=23&rootid=&id=38678)


--  作者:adiros
--  发布时间:10/9/2006 7:42:00 PM

--  在xsd 里到底能不能进行两次complexType 嵌套???/
<xsd:complexType name="bookType">
<xsd:element name="book" minOccurs="0" maxOccurs="10">
   <xsd:complexType>
     <xsd:sequence>
      <xsd:element name="bookTitle" type="xsd:string"/>
      <xsd:element name="pubDate" type="xsd:date" minccurs='0'/>
      <xsd:element name="replacementValue" type="xsd:string"/>
      <xsd:element name="maxDaysOut">
         <xsd:simpleType base="xsd:integer">
            <xsd:restriction base="xsd:integer">
                 <xsd:maxExclusive value="14"/>
            </xsd:restriction>
         </xsd:simpleType>
      </xsd:element>     
     </xsd:sequence>
     <xsd:attribute name="bookID" type="catalogID"/>
   </xsd:complexType>  
</xsd:element>
</xsd:complexType>
--  作者:adiros
--  发布时间:10/9/2006 7:50:00 PM

--  
大家过来看一下嘛!帮帮小弟
--  作者:whu531
--  发布时间:10/11/2006 7:56:00 AM

--  
可以  问什么不可以!!!
复杂类型只是一种形式!他用来描述元素,既然元素需要,那么可2次嵌套 !
但是建议以后这样的写法习惯改为REF写法!看起来结构清晰!
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
31.250ms