XML Schema simpleContent 元素
完整 XML Schema 參考手冊
定義和用法
simpleContent 元素包含對 complexType 元素(它以字符數(shù)據(jù)或 simpleType 元素為內(nèi)容)的擴展或限制并且不包含任何元素。
元素信息
語法
<simpleContent
id=ID
any attributes
>
(annotation?,(restriction|extension))
</simpleContent>
(? 符號聲明在 simpleContent 元素中該元素可出現(xiàn)零次或一次。)
屬性 | 描述 |
id | 可選。規(guī)定該元素的唯一的 ID。 |
any?attributes | 可選。規(guī)定帶有 non-schema 命名空間的任何其他屬性。 |
實例 1
這是一個僅包含文本的 XML 元素 (<shoesize>):
<shoesize country="france">35</shoesize>
下面的例子聲明了一個復(fù)雜類型 "shoesize",其內(nèi)容被定義為整數(shù)數(shù)據(jù)類型,并帶有一個 country 屬性:
<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>
完整 XML Schema 參考手冊
更多建議: