XML Schema redefine ਏਜੰਟ

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

redefine ਏਜੰਟ ਨੂੰ ਵਰਤਕੇ ਮੌਜੂਦਾ Schema ਵਿੱਚ ਬਾਹਰੀ ਢਾਂਚੇ ਫਾਇਲ ਤੋਂ ਲਏ ਗਏ ਸਰਲ ਅਤੇ ਜਟਿਲ ਤਰੀਕੇ, ਗਰੁੱਪ ਅਤੇ ਵਿਸ਼ੇਸ਼ਤਾ ਗਰੁੱਪ ਮੁੜ ਨਿਰਧਾਰਿਤ ਕੀਤਾ ਜਾ ਸਕਦਾ ਹੈ。

ਏਜੰਟ ਸੂਚਨਾ

ਆਉਣ ਵਾਲੀ ਗੱਲ ਅਸੀਮਿਤ
ਮੂਲ ਏਜੰਟ schema
ਸਮੱਗਰੀ annotation、attributeGroup、complexType、group、simpleType

ਸ਼ਾਸਤਰ

<redefine
id=ID
schemaLocation=anyURI
ਕਿਸੇ ਵੀ ਵਿਸ਼ੇਸ਼ਤਾ
>
(annotation|(simpleType|complexType|group|attributeGroup))*
</redefine>
ਵਿਸ਼ੇਸ਼ਤਾ ਵਰਣਨ
id ਵਿਕਲਪੀ।ਇਸ ਏਜੰਟ ਦੇ ਅਨੂਨ੍ਯ ID ਨਿਰਧਾਰਣ ਕਰਦਾ ਹੈ。
schemaLocation ਲਾਜ਼ਮੀ।schema ਦਸਤਾਵੇਜ਼ ਦੀ ਸਥਿਤੀ ਦੀ URI ਨਿਰਦੇਸ਼ਣ ਕਰਦਾ ਹੈ。
ਕਿਸੇ ਵੀ ਵਿਸ਼ੇਸ਼ਤਾ ਵਿਕਲਪੀ।non-schema ਨਾਮ ਸਪੇਸ ਵਾਲੇ ਕਿਸੇ ਹੋਰ ਵਿਸ਼ੇਸ਼ਤਾ ਦੀ ਨਿਰਧਾਰਣ ਕਰਦਾ ਹੈ।

ਮਾਡਲ

ਉਦਾਹਰਣ 1

ਇਸ ਉਦਾਹਰਣ ਵਿੱਚ ਇੱਕ schema, Myschama2.xsd, ਦਿਸ਼ਾ ਦਿੱਤੀ ਗਈ ਹੈ ਜਿਸ ਵਿੱਚ Myschama1.xsd ਦੁਆਰਾ ਨਿਰਧਾਰਿਤ ਏਜੰਟ ਮੌਜੂਦ ਹਨ।pname ਤਰੀਕੇ ਮੁੜ ਨਿਰਧਾਰਿਤ ਕੀਤਾ ਗਿਆ ਹੈ।ਇਸ schema ਦੇ ਅਨੁਸਾਰ, 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>