<xsd:extension> 元素 (simpleContent)

包含对 simpleContent 的扩展。 通过添加指定属性、属性组或 anyAttribute,扩展了简单类型或具有简单内容的复杂类型。

<extension
  base = QName
  id = ID
  {any attributes with non-schema Namespace}...>
Content: (annotation?, ((attribute | attributeGroup)*, anyAttribute?))
</extension> 

特性

  • base
    内置数据类型、simpleType 元素或具有简单内容的 complexType 的名称。

    基值必须是限定名 (QName)。

    必选。

  • id
    该元素的 ID。 id 值必须属于类型 ID 并且在包含该元素的文档中是唯一的。

    可选。

元素信息

出现次数

一次

父元素

simpleContent

内容

annotationattributeattributeGroupanyAttribute

示例

以下示例通过添加枚举的属性扩展定义的 simpleType

其他资源

有关更多信息,请参见 W3C 网站上的 W3C XML Schema Part 1: Structures Recommendation(W3C XML 架构第 1 部分:架构建议)文档。

另请参见

参考

XML 架构 (XSD) 参考
XML 架构元素