以文本方式查看主题

-  W3CHINA.ORG讨论区 - 语义网·描述逻辑·本体·RDF·OWL  (http://bbs.xml.org.cn/index.asp)
--  『 DTD/XML Schema 』  (http://bbs.xml.org.cn/list.asp?boardid=23)
----  请教,在Schema中定义了属性,在XML中怎么用?[求助]  (http://bbs.xml.org.cn/dispbbs.asp?boardid=23&rootid=&id=22324)


--  作者:smartgill
--  发布时间:9/18/2005 5:10:00 PM

--  请教,在Schema中定义了属性,在XML中怎么用?[求助]
我在Schema文档中定义了
<xs:complexType name="BedchamberType">
       <xs:sequence>
          <xs:element name="寝室号" type="xs:string"/>
           <xs:element name="寝室电话" type="live:PhoneType"/>
           <xs:element name="寝室成员" type="xs:string"/>
        </xs:sequence>
   [color=#FF0000]  [B]<xs:attribute name="寝室人数" type="xs:int" fixed="4"/>[/B[/color]]</xs:complexType>
然后在XML文档中添加数据时,检验出错,为什么?
<寝室>
   
   <寝室号>402</寝室号>
   <寝室电话>86838724</寝室电话>
   <寝室成员>李云霞,吕柳芬,陈楠,韩英琼</寝室成员>
   [B][/B]<寝室 寝室人数="4"/>  </寝室>
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
7,515.625ms