Element XML Schema simpleContent
Definicja i Wykorzystanie
Element simpleContent zawiera element complexType (jest simpleType pierwiastek lub dane znakowe Content) rozszerzony lub ograniczony i nie zawiera żadnych elementów.
Element informacji
- Parent Element: complexType
gramatyka
<simpleContent
id=ID
any attributes
>
(annotation?,(restriction|extension))
</simpleContent>
id=ID
any attributes
>
(annotation?,(restriction|extension))
</simpleContent>
(? Znak deklaruje, że element simpleContent element może wystąpić zero lub jeden raz).
属性 | 描述 |
---|---|
id | 可选。规定该元素的唯一的 ID。 |
any attributes | 可选。规定带有 non-schema 命名空间的任何其他属性。 |
Przykład 1
Jest to element XML, który zawiera tylko tekst (<shoesize>)
<shoesize country="france">35</shoesize>
Poniższy przykład deklaruje złożonego typu "shoesize", którego treść jest zdefiniowany jako typ danych Integer, a krajem z atrybutami:
<xs:element name="shoesize">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:integer">
<xs:attribute name="country" type="xs:string" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:integer">
<xs:attribute name="country" type="xs:string" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
Kompletna XML Schema Reference