zoukankan      html  css  js  c++  java
  • 在W3C SCHOOL网站上发现一个关于Schema的错误

    原地址是http://www.w3school.com.cn/schema/schema_complex_empty.asp

    下面这个例子是不正确的 xmlspy报错。

    因为<xs:restriction base="xs:integer">定义的这个integer不是复杂类型,

    comlexContent包含的应该是复杂类型,integer不是。所以应该用simpleContent

    complexContent    定义对复杂类型(包含混合内容或仅包含元素)的扩展或限制。

    simpleContent    包含对 complexType 元素的扩展或限制且不包含任何元素。

    <xs:element name="product">

      <xs:complexType>

        <xs:complexContent>

          <xs:restriction base="xs:integer">

            <xs:attribute name="prodid" type="xs:positiveInteger"/>

          </xs:restriction>

        </xs:complexContent>

      </xs:complexType>

    </xs:element>

    下面这个是正确的

    <xs:element name="product"> 

        <xs:complexType>  

            <xs:simpleContent>   

                <xs:extension base="xs:integer">    

                    <xs:attribute name="prodid" type="xs:positiveInteger"/>  

                </xs:extension>  

            </xs:simpleContent> 

        </xs:complexType>

    </xs:element>

  • 相关阅读:
    linux运维、架构之路-MySQL主从复制
    多线程
    IO
    查看信息
    乱码
    字节流与字符流
    file
    JDBC
    规范
    Java常用包
  • 原文地址:https://www.cnblogs.com/or2-/p/3452465.html
Copyright © 2011-2022 走看看