新书推介:《语义网技术体系》
作者:瞿裕忠,胡伟,程龚
   >>中国XML论坛<<     W3CHINA.ORG讨论区     计算机科学论坛     SOAChina论坛     Blog     开放翻译计划     新浪微博  
 
  • 首页
  • 登录
  • 注册
  • 软件下载
  • 资料下载
  • 核心成员
  • 帮助
  •   Add to Google

    >> DTD, XML Schema(XMLS), RELAX NG
    [返回] 中文XML论坛 - 专业的XML技术讨论区XML.ORG.CN讨论区 - XML技术『 DTD/XML Schema 』 → 在book.xsd里有个问题,请哪位大哥给点建议!!! 查看新帖用户列表

      发表一个新主题  发表一个新投票  回复主题  (订阅本版) 您是本帖的第 32745 个阅读者浏览上一篇主题  刷新本主题   平板显示贴子 浏览下一篇主题
     * 贴子主题: 在book.xsd里有个问题,请哪位大哥给点建议!!! 举报  打印  推荐  IE收藏夹 
       本主题类别:     
     adiros 帅哥哟,离线,有人找我吗?
      
      
      等级:大一(高数修炼中)
      文章:32
      积分:186
      门派:XML.ORG.CN
      注册:2006/9/20

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给adiros发送一个短消息 把adiros加入好友 查看adiros的个人资料 搜索adiros在『 DTD/XML Schema 』的所有贴子 引用回复这个贴子 回复这个贴子 查看adiros的博客楼主
    发贴心情 在book.xsd里有个问题,请哪位大哥给点建议!!!

    在book.xsd里有个问题,请哪位大哥给点建议!!!
    <?xml version="1.0"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:element name="transaction" type="transactionType"/>
    <xsd:complexType name="transactionType">  
      <xsd:sequence>    
          <xsd:element name="lender" type="addresType"/>
          <xsd:element name="borrower" type="addresType"/>
          <xsd:element ref="note" minOccurs="0"/>
          <xsd:element name="books" type="bookType"/>
      </xsd:sequence>    
          <xsd:attribute name="borrowDate" type="xsd:date"/>
    </xsd:complexType>
    <xsd:element name="note" type="xsd:string"/>
    <xsd:complexType name="addressType">
      <xsd:sequence>
           <xsd:element name="name" type="xsd:string"/>
           <xsd:element name="street" type="xsd:string"/>
           <xsd:element name="city" type="xsd:string"/>
           <xsd:element name="state" type="xsd:string"/>
      </xsd:sequence>     
           <xsd:attribute name="borrowDate" type="xsd:date"/>       
    </xsd:complexType>

    <xsd:complexType name="bookType">
    <xsd:element name="book" minOccurs="0" maxOccurs="10">
       <xsd:complexType>
         <xsd:sequence>
          <xsd:element name="bookTitle" type="xsd:string"/>
          <xsd:element name="pubDate" type="xsd:date" minccurs='0'/>
          <xsd:element name="replacementValue" type="xsd:string"/>
          <xsd:element name="maxDaysOut">
             <xsd:simpleType base="xsd:integer">
                <xsd:restriction base="xsd:integer">
                     <xsd:maxExclusive value="14"/>
                </xsd:restriction>
             </xsd:simpleType>
          </xsd:element>     
         </xsd:sequence>
         <xsd:attribute name="bookID" type="catalogID"/>
       </xsd:complexType>  
    </xsd:element>
    </xsd:complexType>

    <xsd:simpleType name="catalogID">
        <xsd:restriction base="xsd:string">
            <xsd:pattern value="\d{3}-\d{4}-\d{3}"/>
        </xsd:restriction>
    </xsd:simpleType>     
    </xsd:schema>
    在transtaction.xml 这个调用没问题 !
    <?xml version="1.0"?>
    <transaction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="book.xsd"  borrowDate="2001-10-15">
       <lender phone="9903 44563">
             <name>Michael Calder</name>
             <street>41 mcmahons rd</street>
             <city>frankston</city>
             <state>vic</state>
       </lender>
       <borrower phone="9903 3455">
             <name>carig gavin</name>
             <street>56 overprt rd</street>
             <city>karingal</city>
             <state>vic</state>
       </borrower>       
       <note>lender wants these back in two weeks</note>
       <books>
          <book bookID="123-4567-890">
               <bookTitle>Earthquarkes for breakfast</bookTitle>
               <pubDate>2001-10-20</pubDate>
               <replacementValue>15.95</replacementValue>
               <maxDaysOut>14</maxDaysOut>
          </book>
          <book bookID="123-4567-890">
               <bookTitle>Avalanches for lunch</bookTitle>
               <pubDate>2001-10-21</pubDate>
               <replacementValue>19.99</replacementValue>
               <maxDaysOut>14</maxDaysOut>
          </book>
          <book bookID="123-4567-890">
               <bookTitle>Meteor showers for dinner</bookTitle>
               <pubDate>2001-10-22</pubDate>
               <replacementValue>11.95</replacementValue>
               <maxDaysOut>14</maxDaysOut>
          </book>
          <book bookID="123-4567-890">
               <bookTitle>Snacking on Volcanoes</bookTitle>
               <pubDate>2001-10-23</pubDate>
               <replacementValue>17.99</replacementValue>
               <maxDaysOut>14</maxDaysOut>
          </book>
          
       </books>   
    </transaction>


       收藏   分享  
    顶(1)
      




    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2006/10/8 20:00:00
     
     GoogleAdSense
      
      
      等级:大一新生
      文章:1
      积分:50
      门派:无门无派
      院校:未填写
      注册:2007-01-01
    给Google AdSense发送一个短消息 把Google AdSense加入好友 查看Google AdSense的个人资料 搜索Google AdSense在『 DTD/XML Schema 』的所有贴子 访问Google AdSense的主页 引用回复这个贴子 回复这个贴子 查看Google AdSense的博客广告
    2024/5/28 1:39:36

    本主题贴数13,分页: [1] [2]

     *树形目录 (最近20个回帖) 顶端 
    主题:  在book.xsd里有个问题,请哪位大哥给点建议!!!(3590字) - adiros,2006年10月8日
        回复:  <xsd:complexType name="bookType"> <xsd:sequence..(753字) - adiros,2006年10月13日
        回复:  加我QQ:260959420!大哥!(24字) - adiros,2006年10月12日
        回复:  大哥有QQ?我的:260959420加我大哥!!!(43字) - adiros,2006年10月12日
        回复:  在xmlspy2005版里还是有问题!(28字) - adiros,2006年10月12日
        回复:  大哥,还是与问题啊!(20字) - adiros,2006年10月12日
        回复:  <xsd:complexType name="bookType"> <xsd:element n..(756字) - gemingke,2006年10月12日
        回复:  我才刚学习这个!有的问题真的不晓得啊!(40字) - adiros,2006年10月11日
        回复:  能具体点吗?大哥!/!!(23字) - adiros,2006年10月11日
        回复:  既然不能两次嵌套,对于element“book”可以用引用的方式嘛(55字) - gemingke,2006年10月10日
        回复:  你的问题在哪?指出来总可以吧,全是代码(37字) - gemingke,2006年10月9日
            回复:  <xsd:complexType name="bookType"> <xsd:element n..(783字) - adiros,2006年10月9日
        回复:  怎么今天也没人爱?!(18字) - adiros,2006年10月8日

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