XML Schema union ਏਜੈਂਟ
ਨਿਰਧਾਰਣ ਅਤੇ ਵਰਤੋਂ
union ਏਜੈਂਟ ਸਰਲ ਟਾਈਪ ਦੇ ਕਈ ਸਰਲ ਟਾਈਪਾਂ ਦੇ ਸਮੂਹ ਨੂੰ ਨਿਰਧਾਰਿਤ ਕਰਦਾ ਹੈ。
ਏਜੈਂਟ ਸੂਚਨਾ
ਦਿਸ਼ਾ | ਇੱਕ ਵਾਰ |
ਮੂਲ ਏਜੈਂਟ | simpleType |
ਸਮੱਗਰੀ | annotation、simpleType |
ਗਰਮਾਤਰਾ
<union id=ID memberTypes="list of QNames" ਕਿਸੇ ਗੁਣ ਨੂੰ ਚੋਣੀ ਹੋਈ > (annotation?,(simpleType*)) </union>
(? ਸਿੰਕਰਣ ਯੂਨੀਅਨ ਏਜੈਂਟ ਵਿੱਚ ਇਹ ਏਜੈਂਟ ਕੋਈ ਵੀ ਸਮਾਂ ਜਾਂ ਇੱਕ ਵਾਰ ਦਿਖਾਈ ਦੇ ਸਕਦਾ ਹੈ。)
ਗੁਣ | ਵਰਣਨ |
---|---|
id | ਚੋਣੀ ਹੋਈ। ਇਸ ਏਜੈਂਟ ਦੇ ਅਨੂਠੇ 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>