以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 DTD/XML Schema 』  (http://bbs.xml.org.cn/list.asp?boardid=23)
----  [求助]一个有关schema的问题想请教大家,懂的请帮我一下!  (http://bbs.xml.org.cn/dispbbs.asp?boardid=23&rootid=&id=28283)


--  作者:okli096
--  发布时间:3/8/2006 12:02:00 PM

--  [求助]一个有关schema的问题想请教大家,懂的请帮我一下!
<xs:complexType name="印章">
      <xs:complexContent>
           <xs:extension base="xs:anyType"></xs:extension>      </xs:complexContent>
</xs:complexType>

<xs:element name="签发人名章" nillable="true">
      <xs:complexType>
             <xs:complexContent>
   <xs:extension base="印章">
        <xs:attribute name="签发人职务"      type="xs:string"use="required"></xs:attribute>
   </xs:extension>
                 </xs:complexContent>
       </xs:complexType>
</xs:element>

<xs:element name="单位印章"   nillable="true">
     <xs:complexType>
          <xs:complexContent>
 <xs:extension base="印章">
      <xs:attribute name="发文机关名称" type="xs:string" use="required"></xs:attribute>
 </xs:extension>
          </xs:complexContent>
     </xs:complexType>
</xs:element>

请问一下anyType是什么类型来的?xmlwriter老提示出错!还有就是nillable="true"也提示出错,说什么不能使用这个属性之类的错误!究竟什么回事啊,大家知道吗?


--  作者:wFirebird
--  发布时间:3/10/2006 10:27:00 AM

--  
nillable是用来定义空元素,你的元素居然还是<complexType>,结局当然是提示出错。
nillable=“false”表示元素不能为空(同时是默认属性),nillable=“true”表示元素可以为空。
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
8,933.594ms