XML Schema redefine ఎలిమెంట్

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

redefine ఎలిమెంట్ ప్రస్తుత స్కీమాలో విదేశీ స్కీమా ఫైల్స్ నుండి పొందిన సాధారణ మరియు క్లిష్టమైన రకాలను, గ్రూప్స్ మరియు అట్రిబ్యూట్ గ్రూప్స్ ను పునర్నిర్వచించగలదు.

ఎలిమెంట్ సమాచారం

కనిపించే సంఖ్య పరిమితి లేదు
ప్రాతిపదిక schema
సిరిస్తులు annotation, attributeGroup, complexType, group, simpleType

విధానం

<redefine
id=ID
schemaLocation=anyURI
ఏదైనా అంశాలు
>
(annotation|(simpleType|complexType|group|attributeGroup))*
</redefine>
అంశాలు వివరణ
id ఎంపిక. ఈ ఎలిమెంట్ని ప్రత్యేకమైన ID తో నిర్వచిస్తుంది.
schemaLocation అవసరం. స్కీమా పత్రం స్థానాన్ని యురి పేరును సూచిస్తుంది.
ఏదైనా అంశాలు ఎంపిక. non-schema నామసంకేతంతో కూడిన ఏదైనా అంశాలను నిర్వచిస్తుంది.

ఉదాహరణ

ఉదాహరణ 1

ఈ ఉదాహరణ ఒక స్కీమాను ప్రదర్శిస్తుంది, Myschama2.xsd ఇది Myschama1.xsd ద్వారా నిర్వచించబడిన ఎలిమెంట్స్ను కలిగి ఉంటుంది. pname రకాన్ని పునర్నిర్వచించబడింది. ఈ స్కీమా ప్రకారం, pname ద్వారా సంకేతించబడిన ఎలిమెంట్స్ ముగించుకునే "country" ఎలిమెంట్ను కలిగి ఉండాలి:

Myschema1.xsd:

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="pname">
  <xs:sequence>
    <xs:element name="firstname"/>
    <xs:element name="lastname"/>
  </xs:sequence>
</xs:complexType>
<xs:element name="customer" type="pname"/>
</xs:schema>

Myschema2.xsd:

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:redefine schemaLocation="Myschema1.xsd">
  <xs:complexType name="pname">
    <xs:complexContent>
      <xs:extension base="pname">
        <xs:sequence>
          <xs:element name="country"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:redefine>
<xs:element name="author" type="pname"/>
</xs:schema>