以文本方式查看主题

-  中文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=73733)


--  作者:psz850917
--  发布时间:4/1/2009 11:19:00 AM

--  请教一下关于Schema
<Breakfast_menu >
 <Food id=”1”>
  <Name> 家庭式早餐 </Name>
 </Food>
 <Food id=”2”>
  <Name> 法国吐司 </Name>
 </Food>
 <Food id=”3”>
  <Name> 草莓比利时松饼 </Name>
 </Food>
 <Food id=”4”>
  <Name> 蓝莓比利时松饼 </Name>
 </Food>
</Breakfast_menu>

写出该文档的Schema请教一下,
先谢谢了。


--  作者:psz850917
--  发布时间:4/1/2009 11:19:00 AM

--  
在线等。。。
--  作者:psz850917
--  发布时间:4/1/2009 12:51:00 PM

--  
没人告诉我?
--  作者:coldraining
--  发布时间:6/16/2009 10:35:00 AM

--  
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
 <xs:element name="Breakfast_menu">
  <xs:complexType>
   <xs:sequence>
    <xs:element ref="Food" maxOccurs="unbounded"/>
   </xs:sequence>
  </xs:complexType>
 </xs:element>
 <xs:element name="Food">
  <xs:complexType>
   <xs:sequence>
    <xs:element ref="Name"/>
   </xs:sequence>
   <xs:attribute name="id" use="required">
    <xs:simpleType>
     <xs:restriction base="xs:string">
      <xs:enumeration value="1"/>
      <xs:enumeration value="2"/>
      <xs:enumeration value="3"/>
      <xs:enumeration value="4"/>
     </xs:restriction>
    </xs:simpleType>
   </xs:attribute>
  </xs:complexType>
 </xs:element>
 <xs:element name="Name">
  <xs:simpleType>
   <xs:restriction base="xs:string">
    <xs:enumeration value=" 家庭式早餐 "/>
    <xs:enumeration value=" 法国吐司 "/>
    <xs:enumeration value=" 草莓比利时松饼 "/>
    <xs:enumeration value=" 蓝莓比利时松饼 "/>
   </xs:restriction>
  </xs:simpleType>
 </xs:element>
</xs:schema>

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