zoukankan      html  css  js  c++  java
  • XML Schema complexContent 元素

    定义和用法

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

    元素信息

    出现次数 一次
    父元素 complexType
    内容

    可选项。annotation

    必选项。 有并且只有一个下列元素: restriction (complexContent) 或 extension (complexContent)。

    语法

    <complexContent
    id=ID
    mixed=true|false
    any attributes
    >
    
    (annotation?,(restriction|extension))
    
    </complexContent>

    (? 符号声明元素可在 complexContent 元素内出现零次或一次。)

    属性描述
    id 可选。规定该元素的唯一的 ID。
    mixed 可选。规定是否允许字符数据出现在该 complexType 元素的子元素之间。 默认值为 false。
    any attributes 可选。规定带有 non-schema 命名空间的任何其他属性。

    实例

    下面的例子中有一个复杂类型 "fullpersoninfo",这个复杂类型是通过用三个补充的元素扩展继承的类型,从另一个复杂类型 "personinfo" 衍生而来的:

    <xs:element name="employee" type="fullpersoninfo"/>
    
    <xs:complexType name="personinfo">
      <xs:sequence>
        <xs:element name="firstname" type="xs:string"/>
        <xs:element name="lastname" type="xs:string"/>
      </xs:sequence>
    </xs:complexType>
    
    <xs:complexType name="fullpersoninfo">
      <xs:complexContent>
        <xs:extension base="personinfo">
          <xs:sequence>
            <xs:element name="address" type="xs:string"/>
            <xs:element name="city" type="xs:string"/>
            <xs:element name="country" type="xs:string"/>
          </xs:sequence>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>

    在上例中,"employee" 元素必须按顺序包含下面的元素:"firstname"、"lastname"、"address"、"city" 以及 "country"。

  • 相关阅读:
    三伏天,华为路由器 AX3 PRO 发热严重,网络断流,改装散热清凉一夏
    MVC扩展(ControllerFactory VS DependencyResolver)
    MVC扩展(Templated Razor Delegates)
    RouteDebugger分析
    MVC扩展(ModelBinder)
    ORACLE 创建多个游标并嵌套循环
    java final初解
    oracle partition by 与 partition by ... order by 分组
    JS实现函数重载2
    使用XslCompiledTransform将XML 转HTML
  • 原文地址:https://www.cnblogs.com/fatfatdachao/p/3539662.html
Copyright © 2011-2022 走看看