XML Schema union అంశం

నిర్వచనం మరియు వినియోగం

union అంశం పలు simpleType రకాలను నిర్వచించిన సమూహాన్ని నిర్వచిస్తుంది.

అంశం సమాచారం

ప్రక్రియా సంఖ్య ఒకసారి
మూల అంశం simpleType
విషయం annotation, simpleType

సంఘటన

<union
id=ID
memberTypes="జాబితా ప్రతిపాదనలు"
ఏదీ అంశాలు
>
(annotation?,(simpleType*))
</union>

(? చిహ్నం యూనియన్ అంశంలో ఈ అంశం చేరుస్తుంది లేదా చేరకూడదు.)

అంశాలు వివరణ
id ఎంపికము. ఈ అంశం యొక్క ప్రత్యేక ఐడి ని నిర్ధారించండి.
memberTypes ఎంపికము. స్కీమాలో నిర్వచించబడిన ప్రాథమిక డేటా రకాలు లేదా simpleType రకాల పేర్ల జాబితాను నిర్ధారించండి.
ఏదీ అంశాలు ఎంపికము. నాణ్యం లేని శేఖరికం పొందిన ఏ ఇతర అంశాలను నిర్ధారించండి.

ఉదాహరణ

ఉదాహరణ 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>