<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
            xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0"   
            targetNamespace="urn:ietf:params:xml:ns:netconf:notification:1.0"
            elementFormDefault="qualified"
            attributeFormDefault="unqualified"
            xml:lang="en" version="1.0">


   <xs:redefine schemaLocation="RFC_CreateSubscriptionType_Redefination.xsd">
      <xs:annotation>
         <xs:documentation>
            Redefinition of the createSubscriptionType type defined in notification RFC 5277,
            to add the restrictions that apply to filters included in
            create-subscription messages sent to COM.
         </xs:documentation>
      </xs:annotation>
     
    <!-- <create-subscription> operation -->


    <xs:complexType name="createSubscriptionType">
        <xs:complexContent>
            <xs:extension base="createSubscriptionType">
                <xs:all>
                    <xs:element name="stream"
                        type="streamType" minOccurs="0">
                        <xs:annotation>
                            <xs:documentation>
                               An optional parameter that indicates
                               which stream of events is of interest.
                               If not present, then events in the
                               default NETCONF stream will be sent.
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                        <xs:element name="filter"
                            type="filterType"
                            minOccurs="0">
                            <xs:annotation>
                                <xs:documentation>
                                    An optional parameter that indicates
                                    which subset of all possible events
                                    is of interest.  The format of this
                                    parameter is the same as that of the
                                    filter parameter in the NETCONF
                                    protocol operations.  If not
                                    present, all events not precluded
                                    by other parameters will be sent.
                                </xs:documentation>
                            </xs:annotation>
                        </xs:element>
                    <xs:element name="startTime" type="xs:dateTime"
                        minOccurs="0">
                        <xs:annotation>
                            <xs:documentation>
                                A parameter used to trigger the replay
                                feature indicating that the replay
                                should start at the time specified.  If
                                start time is not present, this is not a
                                replay subscription.
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="stopTime" type="xs:dateTime"
                        minOccurs="0">
                        <xs:annotation>
                            <xs:documentation>
                                An optional parameter used with the
                                optional replay feature to indicate the
                                newest notifications of interest.  If
                                stop time is not present, the
                                notifications will continue until the
                                subscription is terminated.  Must be
                                used with startTime.
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="aggregationLevel" type="xs:string"
                        minOccurs="0" >
                            <xs:annotation>
                              <xs:documentation>
                                An optional parameter used to aggregate the
                                notifications in the display.
                              </xs:documentation>
                            </xs:annotation>
                          </xs:element>
                </xs:all>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
  </xs:redefine>

   <xs:simpleType name="streamType">
        <xs:annotation>
            <xs:documentation>
                The name of an event stream.
            </xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string"/>
  </xs:simpleType>

  <xs:simpleType name="FilterType">
   <xs:restriction base="xs:string">
    <xs:annotation>
     <xs:documentation>
       Enumeration of the strings representing the possible filterType values
     </xs:documentation>
    </xs:annotation>
    <xs:enumeration value="subtree"/>
  </xs:restriction>
 </xs:simpleType>

 <xs:complexType name="filterType">
  <xs:sequence maxOccurs="unbounded" minOccurs="0">
   <xs:element ref="event"/>
  </xs:sequence>
  <xs:attribute type="FilterType" name="type" default="subtree"/>
 </xs:complexType>

 <!-- Declaration of the tag <event> -->
 <xs:element name="event" type="COMEventFilterType"/>


 <!-- Type of the tag <event>, inside the tag <filter> of a
   create-subscription message -->
 <xs:complexType name="COMEventFilterType">
   <xs:complexContent>
     <xs:restriction base="xs:anyType">
       <xs:annotation>
         <xs:documentation xml:lang="en">
            Structure of the element(s) to be included in the
            filter element of the create-subscription message.
         </xs:documentation>
       </xs:annotation>
       <xs:sequence>
          <xs:element name="filterType" type="EventStringType"/>
          <xs:element name="filterValue" type="xs:string"/>
       </xs:sequence>
      </xs:restriction>
   </xs:complexContent>
 </xs:complexType>

 <!-- Three types of events for create-subscription filters... -->
 <xs:simpleType name="EventStringType">
   <xs:restriction base="xs:string">
     <xs:annotation>
       <xs:documentation xml:lang="en">
          Enumeration of the strings representing the possible
          types of events supported by the COM notification
          service.
       </xs:documentation>
     </xs:annotation>
     <xs:enumeration value="objectCreated" />
     <xs:enumeration value="objectDeleted" />
     <xs:enumeration value="attributeChanged" />
    </xs:restriction>
 </xs:simpleType>

</xs:schema>