Latest web development tutorials

Element XML Schema attributeGroup

XML Schema Reference Kompletna XML Schema Reference

Definicja i Wykorzystanie

attributeGroup element służy do deklarowania atrybuty są połączone, tak że można łączyć te stwierdzenia, tworząc do typu złożonego.

Element informacji

  • Parent Element: attributeGroup, complexType, schematu, ograniczenia (zarówno simpleContent i complexContent), rozbudowa (zarówno simpleContent i complexContent)

gramatyka

<attributeGroup
id=ID
name=NCName
ref=QName
any attributes
>

(annotation?),((attribute|attributeGroup)*,anyAttribute?))

</attributeGroup>

(? Znak deklaruje attributeGroup elementu, element może wystąpić zero lub jeden raz, * Znak deklaruje, że element może wystąpić zero lub więcej razy).

属性 描述
id 可选。规定该元素的唯一的 ID。
name 可选。规定属性组的名称。name 和 ref 属性不能同时出现。
ref 可选。规定对指定的属性组的引用。name 和 ref 属性不能同时出现。
any attributes 可选。规定带有 non-schema 命名空间的任何其他属性。

Przykład 1

<xs:attributeGroup name="personattr">
<xs:attribute name="attr1" type="string"/>
<xs:attribute name="attr2" type="integer"/>
</xs:attributeGroup>

<xs:complexType name="person">
<xs:attributeGroup ref="personattr"/>
</xs:complexType>

Powyższy przykład definiuje grupę właściwość o nazwie "personattr" za typ złożony o nazwie "osoba" w.


XML Schema Reference Kompletna XML Schema Reference