XML Schema simpleContent element
Definition and Usage
simpleContent element contains a complexType element (it simpleType element or character data content) extended or limited and does not contain any elements.
Element Information
- Parent element: complexType
grammar
<simpleContent
id=ID
any attributes
>
(annotation?,(restriction|extension))
</simpleContent>
id=ID
any attributes
>
(annotation?,(restriction|extension))
</simpleContent>
(? Sign declares that the element simpleContent element can occur zero or one time.)
属性 | 描述 |
---|---|
id | 可选。规定该元素的唯一的 ID。 |
any attributes | 可选。规定带有 non-schema 命名空间的任何其他属性。 |
Example 1
This is an XML element that contains only text (<shoesize>):
<shoesize country="france">35</shoesize>
The following example declares a complex type "shoesize", whose contents are defined as an integer data type, and a country with attributes:
<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>
Complete XML Schema Reference