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

    >> DTD, XML Schema(XMLS), RELAX NG
    [返回] 中文XML论坛 - 专业的XML技术讨论区XML.ORG.CN讨论区 - XML技术『 DTD/XML Schema 』 → 请帮我找找错误 查看新帖用户列表

      发表一个新主题  发表一个新投票  回复主题  (订阅本版) 您是本帖的第 3427 个阅读者浏览上一篇主题  刷新本主题   树形显示贴子 浏览下一篇主题
     * 贴子主题: 请帮我找找错误 举报  打印  推荐  IE收藏夹 
       本主题类别:     
     lao_cai 美女呀,离线,快来找我吧!
      
      
      等级:大二(研究汇编)
      文章:38
      积分:278
      门派:XML.ORG.CN
      注册:2006/2/22

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

    XML文档如下:
    <?xml version="1.0" encoding="gb2312"?>
    <products xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://eb.ecjtu.jx.cn/ d:\My Documents\XML\05电子商务XML\作业\4-products-schema1.xsd">
     <product ID="101">
      <name>XML解析器</name>
      <unitPrice>$100</unitPrice>
     </product>
     <product ID="102">
      <name>XML编辑器</name>
      <unitPrice>$50</unitPrice>
     </product>
     <product ID="103">
      <name>XML工具箱</name>
      <unitPrice>$200</unitPrice>
     </product>
     <product ID="104">
      <name>XML技术用户指导手册</name>
      <unitPrice>$300</unitPrice>
     </product>
    </products>
    schema文档如下:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>

    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"  targetNamespace="http://eb.ecjtu.jx.cn/">
     <xs:element name="name">
      <xs:simpleType>
       <xs:restriction base="xs:string"/>    
      </xs:simpleType>
     </xs:element>
     <xs:element name="product">
      <xs:complexType>
       <xs:sequence>
        <xs:element ref="name"/>
        <xs:element ref="unitPrice"/>
       </xs:sequence>
       <xs:attribute name="ID" use="required">
        <xs:simpleType>
         <xs:restriction base="xs:string">
          <xs:enumeration value="101"/>
          <xs:enumeration value="102"/>
          <xs:enumeration value="103"/>
          <xs:enumeration value="104"/>
         </xs:restriction>
        </xs:simpleType>
       </xs:attribute>
      </xs:complexType>
     </xs:element>
     <xs:element name="products">
      <xs:complexType>
       <xs:sequence>
        <xs:element ref="product" maxOccurs="unbounded"/>
       </xs:sequence>
      </xs:complexType>
     </xs:element>
     <xs:element name="unitPrice">
      <xs:simpleType>
       <xs:restriction base="xs:string">
        <xs:enumeration value="$100"/>
        <xs:enumeration value="$200"/>
        <xs:enumeration value="$300"/>
        <xs:enumeration value="$50"/>
       </xs:restriction>
      </xs:simpleType>
     </xs:element>
    </xs:schema>
    怎么也能不过验证,总说我的product没有定义,可是明明定义了,哪位高手能帮忙解决一下


       收藏   分享  
    顶(0)
      




    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2007/2/23 12:16:00
     
     admin 帅哥哟,离线,有人找我吗?
      
      
      
      威望:9
      头衔:W3China站长
      等级:计算机硕士学位(管理员)
      文章:5255
      积分:18406
      门派:W3CHINA.ORG
      注册:2003/10/5

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给admin发送一个短消息 把admin加入好友 查看admin的个人资料 搜索admin在『 DTD/XML Schema 』的所有贴子 点击这里发送电邮给admin  访问admin的主页 引用回复这个贴子 回复这个贴子 查看admin的博客2
    发贴心情 
    定义缺省名称空间就好了:
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"  targetNamespace="http://eb.ecjtu.jx.cn/" xmlns="http://eb.ecjtu.jx.cn/" >

    [此贴子已经被作者于2007-2-25 0:39:53编辑过]

    ----------------------------------------------

    -----------------------------------------------

    第十二章第一节《用ROR创建面向资源的服务》
    第十二章第二节《用Restlet创建面向资源的服务》
    第三章《REST式服务有什么不同》
    InfoQ SOA首席编辑胡键评《RESTful Web Services中文版》
    [InfoQ文章]解答有关REST的十点疑惑

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2007/2/24 0:50:00
     
     lao_cai 美女呀,离线,快来找我吧!
      
      
      等级:大二(研究汇编)
      文章:38
      积分:278
      门派:XML.ORG.CN
      注册:2006/2/22

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给lao_cai发送一个短消息 把lao_cai加入好友 查看lao_cai的个人资料 搜索lao_cai在『 DTD/XML Schema 』的所有贴子 引用回复这个贴子 回复这个贴子 查看lao_cai的博客3
    发贴心情 
    真是高手,谢谢
    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2007/2/25 18:01:00
     
     GoogleAdSense
      
      
      等级:大一新生
      文章:1
      积分:50
      门派:无门无派
      院校:未填写
      注册:2007-01-01
    给Google AdSense发送一个短消息 把Google AdSense加入好友 查看Google AdSense的个人资料 搜索Google AdSense在『 DTD/XML Schema 』的所有贴子 访问Google AdSense的主页 引用回复这个贴子 回复这个贴子 查看Google AdSense的博客广告
    2024/5/29 8:44:17

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

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