XML Schema 参考手册 完整 XML Schema 参考手册 The simpleContent element contains extensions or restrictions to the complexType element, which takes character data or simpleType elements as its content, and does not contain any elements. 父元素: ComplexType (? The symbol declares that the element can appear zero or once in the simpleContent element. ) Attribute Description Id Optional. Specifies the unique ID of the element. any attributes Optional. Specifies any other attributes with the non-schema namespace. This is a XML element (< shoesize >) that contains only text: The following example declares a complex type “shoesize” whose content is defined as an integer data type with a country attribute:Definition and usage ¶
Element information ¶
Grammar ¶
<simpleContent
id=ID
*any attributes*
>
(annotation?,(restriction|extension))
</simpleContent>
Example 1 ¶
<shoesize country="france">35</shoesize>
<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>