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

    >> DTD, XML Schema(XMLS), RELAX NG
    [返回] 中文XML论坛 - 专业的XML技术讨论区XML.ORG.CN讨论区 - XML技术『 DTD/XML Schema 』 → [求助]各位大哥,我想问问关于group和attributegroup在schemal中的用法 查看新帖用户列表

      发表一个新主题  发表一个新投票  回复主题  (订阅本版) 您是本帖的第 6402 个阅读者浏览上一篇主题  刷新本主题   树形显示贴子 浏览下一篇主题
     * 贴子主题: [求助]各位大哥,我想问问关于group和attributegroup在schemal中的用法 举报  打印  推荐  IE收藏夹 
       本主题类别:     
     冰峰 帅哥哟,离线,有人找我吗?水瓶座1982-1-23
      
      
      等级:大一新生
      文章:10
      积分:92
      门派:XML.ORG.CN
      注册:2005/3/10

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给冰峰发送一个短消息 把冰峰加入好友 查看冰峰的个人资料 搜索冰峰在『 DTD/XML Schema 』的所有贴子 引用回复这个贴子 回复这个贴子 查看冰峰的博客楼主
    发贴心情 [求助]各位大哥,我想问问关于group和attributegroup在schemal中的用法

    各位大哥:
        我想问问关于group和attributegroup在schemal中的用法。
        谢了

       收藏   分享  
    顶(0)
      




    ----------------------------------------------
    Simple is simple!

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2005/3/17 10:30:00
     
     wangtng 帅哥哟,离线,有人找我吗?
      
      
      等级:大一(高数修炼中)
      文章:19
      积分:121
      门派:XML.ORG.CN
      注册:2005/8/11

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给wangtng发送一个短消息 把wangtng加入好友 查看wangtng的个人资料 搜索wangtng在『 DTD/XML Schema 』的所有贴子 引用回复这个贴子 回复这个贴子 查看wangtng的博客2
    发贴心情 
    我也存在同样的问题
    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2005/8/16 22:11:00
     
     headman 帅哥哟,离线,有人找我吗?
      
      
      等级:大一(猛啃高等数学)
      文章:14
      积分:107
      门派:XML.ORG.CN
      注册:2005/8/17

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给headman发送一个短消息 把headman加入好友 查看headman的个人资料 搜索headman在『 DTD/XML Schema 』的所有贴子 引用回复这个贴子 回复这个贴子 查看headman的博客3
    发贴心情 
    group Element

    The group element enables you to group together element declarations.
    Note: the group element is just for grouping together element declarations, no attribute declarations allowed!

    <xsd:element name="Book" >
          <xsd:complexType>
                    <xsd:sequence>
                             <xsd:group ref="PublicationElements"/>
                             <xsd:element name="ISBN" type="string"/>
                             <xsd:element name="Reviewer" type="string"/>
                    </xsd:sequence>
          </xsd:complexType>
    </xsd:element>
    <xsd:element name="CD" >
          <xsd:complexType>
                    <xsd:sequence>
                             <xsd:group ref="PublicationElements"/>
                             <xsd:element name="RecordingStudio" type="string"/>
                    </xsd:sequence>
          </xsd:complexType>
    </xsd:element>
    <xsd:group name="PublicationElements">
            <xsd:sequence>
                <xsd:element name="Title" type="xsd:string"/>
                <xsd:element name="Author" type="xsd:string" maxOccurs="unbounded"/>
                <xsd:element name="Date" type="xsd:string"/>
            </xsd:sequence>
    </xsd:group>

    Following is error!!!!!

    <xsd:element name="Book">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:group name="PublicationElements">
                        <xsd:sequence>
                            <xsd:element name="Title" type="xsd:string" minOccurs="0"/>
                            <xsd:element name="Author" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
                            <xsd:element name="Date" type="xsd:string"/>
                        </xsd:sequence>
                    </xsd:group>
                    <xsd:element name="ISBN" type="xsd:string"/>
                    <xsd:element name="Publisher" type="xsd:string"/>
                </xsd:sequence>
                ...
            </xsd:complexType>
        </xsd:element>

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2005/8/19 11:04:00
     
     headman 帅哥哟,离线,有人找我吗?
      
      
      等级:大一(猛啃高等数学)
      文章:14
      积分:107
      门派:XML.ORG.CN
      注册:2005/8/17

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给headman发送一个短消息 把headman加入好友 查看headman的个人资料 搜索headman在『 DTD/XML Schema 』的所有贴子 引用回复这个贴子 回复这个贴子 查看headman的博客4
    发贴心情 
    attributegroup:

    <xsd:element name="BookStore">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element name="Book"  maxOccurs="unbounded">
                        <xsd:complexType>
                            <xsd:sequence>
                                <xsd:element name="Title" type="xsd:string"/>
                                <xsd:element name="Author" type="xsd:string"/>
                                <xsd:element name="Date" type="xsd:string"/>
                                <xsd:element name="ISBN" type="xsd:string"/>                                     
                                <xsd:element name="Publisher" type="xsd:string"/>
                            </xsd:sequence>
                            <xsd:attributeGroup ref="BookAttributes"/>
                        </xsd:complexType>
                    </xsd:element>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
        <xsd:attributeGroup name="BookAttributes">
            <xsd:attribute name="Category" use="required">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:string">
                        <xsd:enumeration value="autobiography"/>
                        <xsd:enumeration value="non-fiction"/>
                        <xsd:enumeration value="fiction"/>
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:attribute>
            <xsd:attribute name="InStock" type="xsd:boolean" default="false"/>
            <xsd:attribute name="Reviewer" type="xsd:string" default=" "/>
        </xsd:attributeGroup>

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2005/8/19 11:09:00
     
     zhwpost 帅哥哟,离线,有人找我吗?
      
      
      等级:大一(高数修炼中)
      文章:13
      积分:106
      门派:XML.ORG.CN
      注册:2006/4/3

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给zhwpost发送一个短消息 把zhwpost加入好友 查看zhwpost的个人资料 搜索zhwpost在『 DTD/XML Schema 』的所有贴子 引用回复这个贴子 回复这个贴子 查看zhwpost的博客5
    发贴心情 
    学习中
    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2006/4/3 9:15:00
     
     highthand 帅哥哟,离线,有人找我吗?
      
      
      等级:大一新生
      文章:4
      积分:81
      门派:XML.ORG.CN
      注册:2006/3/31

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给highthand发送一个短消息 把highthand加入好友 查看highthand的个人资料 搜索highthand在『 DTD/XML Schema 』的所有贴子 引用回复这个贴子 回复这个贴子 查看highthand的博客6
    发贴心情 
    谢谢二楼的兄弟,看了有收获.
    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2006/4/5 22:40:00
     
     GoogleAdSense
      
      
      等级:大一新生
      文章:1
      积分:50
      门派:无门无派
      院校:未填写
      注册:2007-01-01
    给Google AdSense发送一个短消息 把Google AdSense加入好友 查看Google AdSense的个人资料 搜索Google AdSense在『 DTD/XML Schema 』的所有贴子 访问Google AdSense的主页 引用回复这个贴子 回复这个贴子 查看Google AdSense的博客广告
    2025/5/26 1:53:32

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

    管理选项修改tag | 锁定 | 解锁 | 提升 | 删除 | 移动 | 固顶 | 总固顶 | 奖励 | 惩罚 | 发布公告
    W3C Contributing Supporter! W 3 C h i n a ( since 2003 ) 旗 下 站 点
    苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
    250.000ms