XML Schema union ਇਲੈਕਟਰਨ

ਨਿਰਧਾਰਣ ਅਤੇ ਵਰਤੋਂ

union ਇਲੈਕਟਰਨ ਕਈ ਸਰਲ ਟਾਈਪ ਦੇ ਸਮੂਹ ਨੂੰ ਨਿਰਧਾਰਿਤ ਕਰਦਾ ਹੈ。

ਇਲੈਕਟਰਨ ਸੂਚਨਾ

ਦਿਸ਼ਾ ਇੱਕ ਵਾਰ
ਮੂਲ ਇਲੈਕਟਰਨ simpleType
ਸਮੱਗਰੀ annotation、simpleType

ਗਰੰਥ

<union
id=ID
memberTypes="list of QNames"
ਕਿਸੇ ਵਿਸ਼ੇ ਦੇ ਅਤਰੀਕਤ
>
(annotation?,(simpleType*))
</union>

(? ਚਿੰਨ੍ਹ ਯੂਨੀਅਨ ਇਲੈਕਟਰਨ ਵਿੱਚ ਇਹ ਇਲੈਕਟਰਨ ਕੋਈ ਵੀ ਸਮਾਂ ਜਾਂ ਇੱਕ ਵਾਰ ਦਿਖਾਈ ਦੇ ਸਕਦਾ ਹੈ。)

ਵਿਸ਼ੇ ਵਰਣਨ
id ਵਿਕਲਪੀ। ਇਸ ਇਲੈਕਟਰਨ ਦੇ ਅਨੂਨ੍ਯ ਆਈਡੀ ਨਿਰਧਾਰਿਤ ਕਰੋ。
memberTypes ਵਿਕਲਪੀ। schema ਵਿੱਚ ਨਿਰਧਾਰਿਤ ਕੀਤੇ ਹੋਏ ਬਿਨਾਂ ਸਕੇਮਾ ਦੇ ਅੰਤਰਨਾਮੇ ਜਾਂ simpleType ਇਲੈਕਟਰਨ ਦੇ ਨਾਮ ਸੂਚੀ ਨਿਰਧਾਰਿਤ ਕਰੋ。
ਕਿਸੇ ਵਿਸ਼ੇ ਦੇ ਅਤਰੀਕਤ ਵਿਕਲਪੀ। ਕਿਸੇ non-schema ਨਾਮ ਸਪੇਸ ਦੇ ਕਿਸੇ ਹੋਰ ਵਿਸ਼ੇਸ਼ ਵਿਸ਼ੇ ਨੂੰ ਨਿਰਧਾਰਿਤ ਕਰੋ。

ਉਦਾਹਰਣ

ਉਦਾਹਰਣ 1

ਇਹ ਮਾਮਲਾ ਦੋ ਸਰਲ ਟਾਈਪਾਂ ਦਾ ਮਿਲਾਇਆ ਹੋਇਆ ਸਰਲ ਟਾਈਪ ਹੈ:

<xs:element name="jeans_size">
  <xs:simpleType>
    <xs:union memberTypes="sizebyno sizebystring" />
  </xs:simpleType>
</xs:element>
<xs:simpleType name="sizebyno">
  <xs:restriction base="xs:positiveInteger">
    <xs:maxInclusive value="42"/>
  </xs:restriction>
</xs:simpleType>
<xs:simpleType name="sizebystring">
  <xs:restriction base="xs:string">
    <xs:enumeration value="small"/>
    <xs:enumeration value="medium"/>
    <xs:enumeration value="large"/>
  </xs:restriction>
</xs:simpleType>