以文本方式查看主题

-  计算机科学论坛  (http://bbs.xml.org.cn/index.asp)
--  『 DTD/XML Schema 』  (http://bbs.xml.org.cn/list.asp?boardid=23)
----  一个xmlschema设计的问题  (http://bbs.xml.org.cn/dispbbs.asp?boardid=23&rootid=&id=8166)


--  作者:chenys
--  发布时间:6/7/2004 4:53:00 PM

--  一个xmlschema设计的问题
例子如下,盼望高手解答
<tree>
  <orderItem>1</orderItem>
          <orderItem>2</orderItem>
                  <orderItem>3</orderItem>
                          <orderItem>4</orderItem>
                                   .......
</tree>
orederitem会一直循环下去,schema如何设置呢?
--  作者:admin
--  发布时间:6/8/2004 2:34:00 PM

--  
哪里有循环??
这样写不是更清楚些么:
<tree>
  <orderItem>1</orderItem>
  <orderItem>2</orderItem>
  <orderItem>3</orderItem>
  <orderItem>4</orderItem>
        .......
</tree>

--  作者:admin
--  发布时间:6/8/2004 2:38:00 PM

--  
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <xsd:element name="tree">
  <xsd:complexType>
   <xsd:sequence>
    <xsd:element name="orderItem" type="xsd:integer" maxOccurs="unbounded"/>
   </xsd:sequence>
  </xsd:complexType>
 </xsd:element>
</xsd:schema>
--  作者:chenys
--  发布时间:6/8/2004 3:13:00 PM

--  
抱歉,我没表达清楚,不是循环,是嵌套,一层一层的逐级深入
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
46.875ms