XML Eğitimi

XML ANA SAYFA XML'e Giriş XML nasıl kullanılır XML Ağacı XML Sözdizimi XML Öğeleri XML Öznitelikleri XML Ad Alanları XML Görüntüleme XML HttpTalebi XML Ayrıştırıcı XML DOM'si XML XPath'i XML XSLT'si XML XQuery XML Bağlantısı XML Doğrulayıcı XML DTD'si XML Şeması XML Sunucusu XML Örnekleri XML Testi XML Sertifikası

XML AJAX'ı

AJAX Tanıtımı AJAX XMLHttp AJAX İsteği AJAX Yanıtı AJAX XML Dosyası AJAX PHP AJAX ASP AJAX Veritabanı AJAX Uygulamaları AJAX Örnekleri

XML DOM'si

DOM Tanıtımı DOM Düğümleri DOM Erişimi DOM Düğümü Bilgisi DOM Düğüm Listesi DOM Geçişi DOM Gezinme DOM Değerleri Al DOM Değişiklik Düğümleri DOM Düğümleri Kaldır DOM Düğümleri Değiştir DOM Oluşturma Düğümleri DOM Düğüm Ekle DOM Klon Düğümleri DOM Örnekleri

XPath Eğitimi

XPath Giriş XPath Düğümleri XPath Sözdizimi XPath Eksenleri XPath Operatörleri XPath Örnekleri

XSLT Eğitimi

XSLT'ye Giriş XSL Dilleri XSLT Dönüşümü XSLT <şablon> XSLT <değeri> XSLT <her biri için> XSLT <sıralama> XSLT <if> XSLT <seç> XSLT Uygula İstemcide XSLT Sunucuda XSLT XSLT Düzenleme XML'i XSLT Örnekleri

XQuery Eğitimi

XQuery Tanıtımı XQuery Örneği XQuery FLWOR'u XQuery HTML'si XQuery Terimleri XQuery Sözdizimi XQuery Ekle XQuery Seçimi XQuery İşlevleri

XML DTD'si

DTD Giriş DTD Yapı Taşları DTD Elemanları DTD Özellikleri DTD Elemanları vs Attr DTD Varlıkları DTD Örnekleri

XSD Şeması

XSD Tanıtımı XSD Nasıl Yapılır? XSD <şema> XSD Öğeleri XSD Özellikleri XSD Kısıtlamaları

XSD Kompleksi

XSD Öğeleri XSD Boş Yalnızca XSD Öğeleri Yalnızca XSD Metin XSD Karışık XSD Göstergeleri XSD <herhangi bir> XSD <anyÖzellik> XSD Değiştirme XSD Örneği

XSD Verileri

XSD Dizisi XSD Tarihi XSD Sayısal XSD Çeşitli XSD Referansı

Web Hizmetleri

XML Hizmetleri XML WSDL'si XML SABUN XML RDF'si XML RSS'si

Referanslar

DOM Düğüm Türleri DOM Düğümü DOM Düğüm Listesi DOM Adlandırılmış Düğüm Haritası DOM Belgesi DOM Öğesi DOM Özelliği DOM Metni DOM CDATA DOM Yorumu DOM XMLHttpRequest DOM Ayrıştırıcı XSLT Öğeleri XSLT/XPath İşlevleri

XML Şema öğesi Öğe


❮ Eksiksiz XML Şeması Referansı

Tanım ve Kullanım

Öğe öğesi bir öğeyi tanımlar.

Eleman Bilgileri

  • Ana öğeler: şema, seçim, tümü, sıra, grup

Sözdizimi

<element
id=ID
name=NCName
ref=QName
type=QName
substitutionGroup=QName
default=string
fixed=string
form=qualified|unqualified
maxOccurs=nonNegativeInteger|unbounded
minOccurs=nonNegativeInteger
nillable=true|false
abstract=true|false
block=(#all|list of (extension|restriction))
final=(#all|list of (extension|restriction))
any attributes
>

annotation?,(simpleType|complexType)?,(unique|key|keyref)*

</element>

(? işareti, öğenin sıfır veya bir kez oluşabileceğini bildirir ve * işareti, öğenin öğe öğesi içinde sıfır veya daha fazla kez bulunabileceğini bildirir)

Attribute Description
id Optional. Specifies a unique ID for the element
name Optional. Specifies a name for the element. This attribute is required if the parent element is the schema element
ref Optional. Refers to the name of another element. The ref attribute can include a namespace prefix. This attribute cannot be used if the parent element is the schema element
type Optional. Specifies either the name of a built-in data type, or the name of a simpleType or complexType element
substitutionGroup Optional. Specifies the name of an element that can be substituted with this element. This attribute cannot be used if the parent element is not the schema element
default Optional. Specifies a default value for the element (can only be used if the element's content is a simple type or text only)
fixed Optional. Specifies a fixed value for the element (can only be used if the element's content is a simple type or text only)
form Optional. Specifies the form for the element. "unqualified" indicates that this element is not required to be qualified with the namespace prefix. "qualified" indicates that this element must be qualified with the namespace prefix. The default value is the value of the elementFormDefault attribute of the schema element. This attribute cannot be used if the parent element is the schema element
maxOccurs Optional. Specifies the maximum number of times this element can occur in the parent element. The value can be any number >= 0, or if you want to set no limit on the maximum number, use the value "unbounded". Default value is 1. This attribute cannot be used if the parent element is the schema element
minOccurs Optional. Specifies the minimum number of times this element can occur in the parent element. The value can be any number >= 0. Default value is 1. This attribute cannot be used if the parent element is the schema element
nillable Optional. Specifies whether an explicit null value can be assigned to the element. True enables an instance of the element to have the null attribute set to true. The null attribute is defined as part of the XML Schema namespace for instances. Default is false
abstract Optional. Specifies whether the element can be used in an instance document. True indicates that the element cannot appear in the instance document. Instead, another element whose substitutionGroup attribute contains the qualified name (QName) of this element must appear in this element's place. Default is false
block Optional. Prevents an element with a specified type of derivation from being used in place of this element. This value can contain #all or a list that is a subset of extension, restriction, or equivClass:
  • extension - prevents elements derived by extension
  • restriction - prevents elements derived by restriction
  • substitution - prevents elements derived by substitution
  • #all - prevents all derived elements
final Optional. Sets the default value of the final attribute on the element element.  This attribute cannot be used if the parent element is not the schema element. This value can contain #all or a list that is a subset of extension or restriction:
  • extension - prevents elements derived by extension
  • restriction - prevents elements derived by restriction
  • #all - prevents all derived elements
any attributes Optional. Specifies any other attributes with non-schema namespace

örnek 1

Aşağıdaki örnek, string, nonNegativeInteger ve date türündeki "fname", "lname", "age" ve "dateborn" adlı dört basit öğeye sahip bir şemadır:

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="fname" type="xs:string"/>
<xs:element name="lname" type="xs:string"/>
<xs:element name="age" type="xs:nonNegativeInteger"/>
<xs:element name="dateborn" type="xs:date"/>

</xs:schema>

Örnek 2

Aşağıdaki örnek, karmaşık türde "note" adlı bir öğeye sahip bir şemadır. "Not" öğesi, diğer dört basit öğeyi içerir; "to", "dan", "başlık" ve "gövde":

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="note">
  <xs:complexType>
    <xs:sequence>
      <xs:element name="to" type="xs:string"/>
      <xs:element name="from" type="xs:string"/>
      <xs:element name="heading" type="xs:string"/>
      <xs:element name="body" type="xs:string"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>

</xs:schema>

Örnek 3

Bu örnek, Örnek 2'ye oldukça eşittir, ancak burada eleman adlarına atıfta bulunmak için ref niteliğini kullanmayı seçtik:

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="note">
  <xs:complexType>
    <xs:sequence>
      <xs:element ref="to"/>
      <xs:element ref="from"/>
      <xs:element ref="heading"/>
      <xs:element ref="body"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>

<xs:element name="to" type="xs:string"/>
<xs:element name="from" type="xs:string"/>
<xs:element name="heading" type="xs:string"/>
<xs:element name="body" type="xs:string"/>

</xs:schema>

❮ Eksiksiz XML Şeması Referansı