Elemento XML Schema simpleContent
❮ Riferimento completo allo schema XML
Definizione e utilizzo
L'elemento simpleContent contiene estensioni o restrizioni su un tipo complesso di solo testo o su un tipo semplice come contenuto e non contiene elementi.
Informazioni sull'elemento
- Elementi principali: complexType
Sintassi
<simpleContent
id=ID
any attributes
>
(annotation?,(restriction|extension))
</simpleContent>
(Il segno ? dichiara che l'elemento può verificarsi zero o una volta all'interno dell'elemento simpleContent)
Attribute | Description |
---|---|
id | Optional. Specifies a unique ID for the element |
any attributes | Optional. Specifies any other attributes with non-schema namespace |
Esempio 1
Ecco un esempio di un elemento XML (<shoesize>) che contiene solo testo:
<shoesize country="france">35</shoesize>
L'esempio seguente dichiara un complexType, "shoesize", con il suo contenuto definito come un tipo di dati intero e con un attributo 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>
❮ Riferimento completo allo schema XML