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

    >> DTD, XML Schema(XMLS), RELAX NG
    [返回] 中文XML论坛 - 专业的XML技术讨论区XML.ORG.CN讨论区 - XML技术『 DTD/XML Schema 』 → 有没有人能帮我拍看一下,为什么以下的XML通不过制定的Xml Schema验证 查看新帖用户列表

      发表一个新主题  发表一个新投票  回复主题  (订阅本版) 您是本帖的第 6258 个阅读者浏览上一篇主题  刷新本主题   平板显示贴子 浏览下一篇主题
     * 贴子主题: 有没有人能帮我拍看一下,为什么以下的XML通不过制定的Xml Schema验证 举报  打印  推荐  IE收藏夹 
       本主题类别:     
     jackerlee 帅哥哟,离线,有人找我吗?
      
      
      等级:大一新生
      文章:1
      积分:57
      门派:XML.ORG.CN
      注册:2007/12/9

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给jackerlee发送一个短消息 把jackerlee加入好友 查看jackerlee的个人资料 搜索jackerlee在『 DTD/XML Schema 』的所有贴子 引用回复这个贴子 回复这个贴子 查看jackerlee的博客楼主
    发贴心情 有没有人能帮我拍看一下,为什么以下的XML通不过制定的Xml Schema验证

    Xml Content:
    <?xml version="1.0" encoding="utf-16"?>
    <QueryHotelRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.0.0" xsi:noNamespaceSchemaLocation="file:///c:/temp/compare.xsd">
      <BasicUserInfo Version="1.0.0">
        <AgentId>test</AgentId>
        <AgentPassword>test_password</AgentPassword>
        <RequestTime>2007-12-09T02:49:03.71875+08:00</RequestTime>
      </BasicUserInfo>
      <BasicCriteria>
        <cityName>Changsha</cityName>
        <BookDate>2007-12-09</BookDate>
        <CheckInDate>2007-12-30</CheckInDate>
        <totalNights>2</totalNights>
        <Rooms>
          <AdultNum>2</AdultNum>
          <Quantity>1</Quantity>
        </Rooms>
      </BasicCriteria>
      <AllocationCriteria>
        <returnAllocationStatus>0</returnAllocationStatus>
      </AllocationCriteria>
      <PriceCriteria>
        <Budget>
          <maxBudget>9999</maxBudget>
          <minBudget>0</minBudget>
        </Budget>
      </PriceCriteria>
      <HotelInfoCriteria>
        <HotelName/>
        <StarLevel>0</StarLevel>
      </HotelInfoCriteria>
    </QueryHotelRequest>

    Schema Content:
    <?xml version="1.0" encoding="utf-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:element name="QueryHotelRequest" type="QueryHotelRequestType">
        <xs:annotation>
          <xs:documentation>query hotel request structure</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:complexType name="QueryHotelRequestType">
        <xs:complexContent>
          <xs:extension base="BasicRequestType">
            <xs:sequence>
              <xs:element name="BasicCriteria" nillable="false"  type="BasicCriteriaType">
              </xs:element>
              <xs:element name="AllocationCriteria" nillable="false" type="AllocationCriteriaType">
              </xs:element>
              <xs:element name="PriceCriteria" minOccurs="0" maxOccurs="1" type="PriceCriteriaType">
              </xs:element>
              <xs:element name="HotelInfoCriteria" minOccurs="0" maxOccurs="1" type="HotelInfoCriteriaType">
              </xs:element>
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
      <xs:complexType name="BasicCriteriaType">
        <xs:annotation>
          <xs:documentation>the basic criteria for query hotel request,all the field are required</xs:documentation>
        </xs:annotation>
        <xs:sequence>
          <xs:choice>
            <xs:element name="cityName" maxOccurs="1">
              <xs:annotation>
                <xs:documentation>the destination city name</xs:documentation>
              </xs:annotation>
              <xs:simpleType>
                <xs:restriction base="xs:string">
                  <xs:minLength value="1">
                  </xs:minLength>
                </xs:restriction>
              </xs:simpleType>
            </xs:element>
            <xs:element name="airportCode" maxOccurs="1">
              <xs:annotation>
                <xs:documentation>the IATA code</xs:documentation>
              </xs:annotation>
              <xs:complexType>
                <xs:sequence>
                  <xs:element name="airportCode">
                    <xs:annotation>
                      <xs:documentation>
                      </xs:documentation>
                    </xs:annotation>
                    <xs:simpleType>
                      <xs:restriction base="xs:string">
                        <xs:length value="3" />
                      </xs:restriction>
                    </xs:simpleType>
                  </xs:element>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:choice>
          <xs:element name="BookDate">
            <xs:simpleType>
              <xs:restriction base="xs:string">
                <xs:pattern value="^\d{4}-\d{2}-\d{2}$">
                </xs:pattern>
              </xs:restriction>
            </xs:simpleType>
          </xs:element>
          <xs:element name="CheckInDate">
            <xs:simpleType>
              <xs:restriction base="xs:string">
                <xs:pattern value="^\d{4}-\d{2}-\d{2}$">
                </xs:pattern>
              </xs:restriction>
            </xs:simpleType>
          </xs:element>
          <xs:element name="totalNights" type="xs:int">
          </xs:element>
          <xs:element name="Rooms" type="RequestRoomType" minOccurs="1" maxOccurs="5">
          </xs:element>
        </xs:sequence>
      </xs:complexType>
      <xs:complexType name="AllocationCriteriaType">
        <xs:sequence>
          <xs:element name="returnAllocationStatus">
            <xs:annotation>
              <xs:documentation>
              </xs:documentation>
            </xs:annotation>
            <xs:simpleType>
              <xs:restriction base="xs:string">
                <xs:enumeration value="0">
                  <xs:annotation>
                    <xs:documentation>return all the hotel including the on request hotel</xs:documentation>
                  </xs:annotation>
                </xs:enumeration>
                <xs:enumeration value="1">
                  <xs:annotation>
                    <xs:documentation>return the hotel which only available</xs:documentation>
                  </xs:annotation>
                </xs:enumeration>
              </xs:restriction>
            </xs:simpleType>
          </xs:element>
        </xs:sequence>
      </xs:complexType>
      <xs:complexType name="PriceCriteriaType">
        <xs:sequence>
          <xs:element name="Budget" type="BudgetType">
          </xs:element>
        </xs:sequence>
      </xs:complexType>
      <xs:complexType name="BudgetType">
        <xs:sequence>
          <xs:element name="maxBudget" default="99999">
            <xs:simpleType>
              <xs:restriction base="xs:int">
                <xs:minInclusive value="0">
                </xs:minInclusive>
              </xs:restriction>
            </xs:simpleType>
          </xs:element>
          <xs:element name="minBudget" default="1">
            <xs:simpleType>
              <xs:restriction base="xs:int">
                <xs:minInclusive value="0">
                </xs:minInclusive>
              </xs:restriction>
            </xs:simpleType>
          </xs:element>
        </xs:sequence>
      </xs:complexType>
      <xs:complexType name="RequestRoomType">
        <xs:sequence>
          <xs:element name="AdultNum">
            <xs:simpleType>
              <xs:restriction base="xs:int">
                <xs:minInclusive value="1">
                </xs:minInclusive>
              </xs:restriction>
            </xs:simpleType>
          </xs:element>
          <xs:element name="Quantity">
            <xs:simpleType>
              <xs:restriction base="xs:int">
                <xs:minInclusive value="1">
                </xs:minInclusive>
              </xs:restriction>
            </xs:simpleType>
          </xs:element>
        </xs:sequence>
      </xs:complexType>
      <xs:complexType name="HotelInfoCriteriaType">
        <xs:sequence>
          <xs:element name="HotelName" type="xs:string">
          </xs:element>
          <xs:element name="StarLevel">
            <xs:simpleType>
              <xs:restriction base="xs:float">
                <xs:enumeration value="0">
                </xs:enumeration>
                <xs:enumeration value="1">
                </xs:enumeration>
                <xs:enumeration value="1.5">
                </xs:enumeration>
                <xs:enumeration value="2">
                </xs:enumeration>
                <xs:enumeration value="2.5">
                </xs:enumeration>
                <xs:enumeration value="3">
                </xs:enumeration>
                <xs:enumeration value="3.5">
                </xs:enumeration>
                <xs:enumeration value="4">
                </xs:enumeration>
                <xs:enumeration value="4.5">
                </xs:enumeration>
                <xs:enumeration value="5">
                </xs:enumeration>
                <xs:enumeration value="5.5">
                </xs:enumeration>
              </xs:restriction>
            </xs:simpleType>
          </xs:element>
        </xs:sequence>
      </xs:complexType>
      <xs:complexType name="BasicRequestType">
        <xs:sequence>      
          <xs:element name="BasicUserInfo" type="BasicUserInfoType"></xs:element>
          <xs:element name="RequestType" nillable ="false"
                      minOccurs="1" maxOccurs="1" type="xs:string"></xs:element>
        </xs:sequence>
        <xs:attribute name="Version" type="xs:string" use="required" fixed="1.0.0"/>
      </xs:complexType>
      <xs:complexType name="BasicUserInfoType">
        <xs:sequence>
          <xs:element name="AgentId" type="xs:string" default="">
            <xs:annotation>
              <xs:documentation>Unique reference used to identify the client to Cosmos</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="AgentPassword" type="xs:string" default="">
            <xs:annotation>
              <xs:documentation>maybe encrypt in next version</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="RequestTime" type="xs:dateTime">
          </xs:element>
        </xs:sequence>
        <xs:attribute name="Version" type="xs:string" use="required" fixed="1.0.0"></xs:attribute>
      </xs:complexType>
    </xs:schema>


       收藏   分享  
    顶(0)
      




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

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

     *树形目录 (最近20个回帖) 顶端 
    主题:  有没有人能帮我拍看一下,为什么以下的XML通不过制定的Xml Schema验证..(8889字) - jackerlee,2007年12月9日
        回复:  谢谢了!(109字) - jackerlee,2007年12月14日
            回复:  "BookDate使用字符串而不是日期考虑到时区问题"学到了东西.谢谢分享...(70字) - lialer,2007年12月16日
        回复:  检测环境:xp+xmlxpy问题+答案:1、在SCHEMA中定义了requestype元素,但..(2126字) - lialer,2007年12月13日
        回复:  检测环境:xp+xmlxpy在schema中定义了requesttype元素。但..(58字) - lialer,2007年12月13日

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