కోర్సు సిఫార్సులు:
XML Schema complexType ఎలమెంట్
నిర్వచనం మరియు వినియోగం
complexType ఎలమెంట్ సంకీర్ణ రకం నిర్వచించబడింది. సంకీర్ణ రకం ఎలమెంట్ ఇతర ఎలమెంట్లు మరియు / లేదా అంతర్భాగాలు కలిగిన XML ఎలమెంట్.
ప్రక్రియ సమాచారం | కనిపించే సంఖ్య |
ప్రాతిపదిక ఉంది; ప్రక్రియలో ఒకసారి ఉంది. | element、redefine、schema |
వివరణ | annotation、simpleContent、complexContent、group、all、choice、sequence、attribute、attributeGroup、anyAttribute |
వినియోగశాస్త్రం
<complexType id=ID name=NCName abstract=true|false mixed=true|false block=(#all|list of (extension|restriction)) final=(#all|list of (extension|restriction)) ఏదైనా అంశాలు > (annotation?,(simpleContent|complexContent|((group|all| choice|sequence)?,((attribute|attributeGroup)*,anyAttribute?)))) </complexType>
(? సంకేతం complexType మూలకు ప్రకటించబడింది, మూలకు ఒకసారి లేదా రెండుసార్లు కనిపించవచ్చు, * సంకేతం మూలకు అనేకసార్లు కనిపించవచ్చు。)
అంశం
id
ఎంపికబడవచ్చు. ఈ మూలకు వివరించిన ప్రత్యేకమైన ID ను నిర్ణయిస్తుంది.
name
ఎంపికబడవచ్చు. ఈ మూలకు వివరించిన పేరును నిర్ణయిస్తుంది.
abstract
ఎంపికబడవచ్చు. ఈ complexType మూలకు వివరించిన రకాన్ని ఉపయోగించడానికి అనుమతించాలా లేదా లేదా ఉపయోగించబడదు అని నిర్ణయిస్తుంది. ఈ విలువ సంక్షిప్తంగా ఉంటుంది.
mixed
ఎంపికబడవచ్చు. ఈ complexType మూలకు ఉపసమాంతరంగా ఉన్న ఉపమూలకు అక్షర దత్తాంశాన్ని కలిగి ఉండేలా నిర్ణయిస్తుంది. అప్రమేయ విలువ సంక్షిప్తంగా ఉంటుంది.
- ఈ simpleContent మూలకు ఉపసమాంతరంగా ఉన్నప్పుడు, mixed అనునది అనుమతించబడదు.
- ఈ complexContent మూలకు ఉపసమాంతరంగా ఉన్నప్పుడు, ఈ mixed అనునది complexContent మూలకు వివరించిన mixed అనునది ద్వారా రీప్రెస్ చేయబడవచ్చు.
block
ఎంపికబడవచ్చు. ఈ complexType మూలకు వివరించిన పరివర్తన రకాన్ని తరచుకునే రకాన్ని నిరోధిస్తుంది. ఈ విలువ #all లేదా ఒక జాబితాను కలిగి ఉండవచ్చు, ఈ జాబితా extension లేదా restriction యొక్క ఉపవిభాగం ఉంటుంది:
- extension - ఈ complexType మూలకు వివరించిన రకాన్ని తరచుకునే రకాన్ని నిరోధిస్తుంది.
- restriction - ఈ complexType మూలకు వివరించిన రకాన్ని తరచుకునే రకాన్ని నిరోధిస్తుంది.
- #all - ఈ complexType మూలకు వివరించిన రకాన్ని తరచుకునే రకాన్ని నిరోధిస్తుంది.
final
ఎంపికబడవచ్చు. ఈ complexType మూలకు వివరించిన రకాన్ని తరచుకునే రకాన్ని నిరోధిస్తుంది. ఈ విలువ �#all లేదా ఒక జాబితాను కలిగి ఉండవచ్చు, ఈ జాబితా extension లేదా restriction యొక్క ఉపవిభాగం ఉంటుంది.
- extension - విస్తరణ ద్వారా ఉత్తరాధికారాన్ని నిరోధిస్తుంది.
- restriction - పరిమితి ద్వారా ఉత్తరాధికారాన్ని నిరోధిస్తుంది.
- #all - అన్ని ఉత్తరాధికారాలను నిరోధిస్తుంది (విస్తరణ మరియు పరిమితి).
ఏదైనా అంశాలు
ఆప్షణికం. నానో-షేమా నామకాలయంతో కూడిన ఏదైనా ఇతర అంశాలను నిర్దేశించండి.
ఇన్స్టాన్స్
ఉదాహరణ 1
ఈ ఉదాహరణలో "note" పేరుతో కలిగిన క్లిష్టమైన రకం ఉంది:
<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:element>
ఉదాహరణ 2
ఈ ఉదాహరణలో ఒక క్లిష్టమైన రకం "fullpersoninfo" ఉంది, ఇది మూడు అనుబంధ కొలువులు (address, city మరియు country) ఉపయోగించి ఉత్తరాధికార రకాన్ని విస్తరించింది, ఇది మరొక క్లిష్టమైన రకం "personinfo" నుండి ఉత్తరాధికారించింది:
<xs:element name="employee" type="fullpersoninfo"/> <xs:complexType name="personinfo"> <xs:sequence> <xs:element name="firstname" type="xs:string"/> <xs:element name="lastname" type="xs:string"/> <xs:complexType name="fullpersoninfo"> <xs:complexContent> <xs:extension base="personinfo"> <xs:sequence> <xs:element name="address" type="xs:string"/> <xs:element name="city" type="xs:string"/> <xs:element name="country" type="xs:string"/>
在上面的例子中,上面的 "employee" 元素必须按顺序包含下列元素:"firstname", "lastname", "address", "city" 以及 "country"。