XML Şeması tüm Öğe
❮ Eksiksiz XML Şeması Referansı
Tanım ve Kullanım
all öğesi, alt öğelerin herhangi bir sırada görünebileceğini ve her alt öğenin sıfır veya bir kez oluşabileceğini belirtir.
Eleman Bilgileri
- Ana öğeler: grup, ComplexType, kısıtlama (hem simpleContent hem de ComplexContent), uzantı (hem simpleContent hem de ComplexContent)
Sözdizimi
<all
id=ID
maxOccurs=1
minOccurs=0|1
any attributes
>
(annotation?,element*)
</all>
(? işareti, öğenin sıfır veya bir kez oluşabileceğini bildirir ve * işareti, öğenin tüm öğe içinde sıfır veya daha fazla kez bulunabileceğini bildirir)
Attribute | Description |
---|---|
id | Optional. Specifies a unique ID for the element |
maxOccurs | Optional. Specifies the maximum number of times the element can occur. The value must be 1. |
minOccurs | Optional. Specifies the minimum number of times the element can occur. The value can be 0 or 1. Default value is 1 |
any attributes | Optional. Specifies any other attributes with non-schema namespace |
örnek 1
<xs:element name="person">
<xs:complexType>
<xs:all>
<xs:element name="firstname" type="xs:string"/>
<xs:element name="lastname" type="xs:string"/>
</xs:all>
</xs:complexType>
</xs:element>
Yukarıdaki örnek, "ad" ve "soyad" öğelerinin herhangi bir sırada görünebileceğini, ancak her iki öğenin de bir kez ve yalnızca bir kez OLMASI ZORUNLUDUR!
Örnek 2
<xs:element name="person">
<xs:complexType>
<xs:all>
<xs:element name="firstname" type="xs:string" minOccurs="0"/>
<xs:element name="lastname" type="xs:string" minOccurs="0"/>
</xs:all>
</xs:complexType>
</xs:element>
Yukarıdaki örnek, "ad" ve "soyadı" öğelerinin herhangi bir sırada görünebileceğini ve her öğenin sıfır veya bir kez görünebileceğini gösterir!
❮ Eksiksiz XML Şeması Referansı