以文本方式查看主题

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


--  作者:zxpzxpzxp
--  发布时间:7/19/2007 1:49:00 PM

--  schema 书写求助
怎么写下面元素的schema:
<book id="122">xml</book>
谢谢。
--  作者:zxpzxpzxp
--  发布时间:7/19/2007 2:06:00 PM

--  
我写成这样怎么通不过:如下
<xs:element name="book">
    <xs:complextype>
         <xs:attribute name="ID"/>
    </xs:complextype>
</xs:element>
--  作者:DUT_girl
--  发布时间:7/24/2007 5:00:00 PM

--  
try this:

<xs:element name="book">
 <xs:complexType>
  <xs:simpleContent>
   <xs:extension base="xs:string">
    <xs:attribute name="id" type="xs:int"/>
   </xs:extension>
  </xs:simpleContent>
 </xs:complexType>
</xs:element>


see more information in the below linkage:
http://www.w3.org/TR/xmlschema-0/


--  作者:zxpzxpzxp
--  发布时间:7/24/2007 5:20:00 PM

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