Latest web development tutorials

Element XML Schema complexContent

XML Schema Reference Kompletna XML Schema Reference

Definicja i Wykorzystanie

Element complexContent definiuje rozszerzenia lub ograniczenia dotyczące typu złożonego (z zawartością mieszaną lub zawierają tylko elementy).

Element informacji

  • Parent Element: complexType

gramatyka

<complexContent
id=ID
mixed=true|false
any attributes

>

(annotation?,(restriction|extension))

</complexContent>

(? Znak deklaruje, że element może wystąpić zero lub jeden raz w obrębie elementu complexContent).

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

Przykład 1

Poniższy przykład ma złożoną typu "fullpersoninfo", kompleks ten typ co za tym idzie z trzema dodatkowymi elementami typu odziedziczonych z innego typu złożonego "personinfo" pochodzi od:

<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>

W powyższym przykładzie, "pracownik" element musi zawierać następujące elementy w celu: "Book Nazwa", "Nazwisko", "adres", "miasto" i "kraj".


XML Schema Reference Kompletna XML Schema Reference