<?xml version="1.0" encoding="gb2312"?>
<xs:schema targetNamespace="urn:ietf:params:xml:ns:netconf:base:1.0" elementFormDefault="qualified" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <!--
  message-id attribute
  -->
  <xs:simpleType name="messageIdType">
    <xs:restriction base="xs:string">
      <xs:maxLength value="4095" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="editOperationType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="merge"/>
      <xs:enumeration value="replace"/>
      <xs:enumeration value="create"/>
      <xs:enumeration value="delete"/>
      <xs:enumeration value="remove"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:attribute name="operation" type="editOperationType" default="merge"/>
  
  <xs:attribute name="type" >
    <xs:simpleType>
      <xs:restriction base="xs:string">
        <xs:enumeration value="subtree"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:attribute>
  
  <xs:complexType name="get-filter-child-type" />
  <xs:complexType name="get-config-filter-child-type" />
  <xs:complexType name="config-child-type" />
  <xs:complexType name="action-child-type" />
  <xs:complexType name="rpcOperation-Type" />

  <xs:element name="rpcOperation" abstract="true" type="rpcOperation-Type" />
  
  <xs:element name="get-filter-child" type="get-filter-child-type" abstract="true" />
  
  <xs:element name="get-config-filter-child" type="get-config-filter-child-type" abstract="true" />
  
  <xs:element name="config-child" type="config-child-type" abstract="true" />
  
  <xs:element name="action-child" type="action-child-type" abstract="true" />
 
  <!--rpc root element-->
  <xs:element name="rpc">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="rpcOperation" minOccurs="1">
        </xs:element>
      </xs:sequence>
      <xs:attribute name="message-id" type="messageIdType" use="required" />
      <xs:anyAttribute processContents ="skip" />
    </xs:complexType>
  </xs:element>

  <xs:complexType name="source-target-Type">
    <xs:choice>
      <xs:element name="running" type="xs:string" />
    </xs:choice>
  </xs:complexType>
  <xs:element name="target" type="source-target-Type" />
  <xs:element name="source" type="source-target-Type" />


  <!-- rpc\get-config definition-->
  <xs:element name="get-config" substitutionGroup="rpcOperation">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="rpcOperation-Type">
          <xs:sequence>
            <xs:element ref="source" />
            <xs:element name="filter" minOccurs="0">
              <xs:complexType>
                <xs:sequence minOccurs="0" maxOccurs="1">
                  <xs:any maxOccurs="1" namespace="##other" processContents="strict"></xs:any>
                </xs:sequence>
                <xs:attribute name="type" >
                  <xs:simpleType>
                    <xs:restriction base="xs:string">
                      <xs:enumeration value="subtree"/>
                    </xs:restriction>
                  </xs:simpleType>
                </xs:attribute>
                <xs:anyAttribute namespace="urn:ietf:params:xml:ns:netconf:base:1.0" processContents="strict"></xs:anyAttribute>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>

  <!--rpc\get-bulk-config definition-->
  <xs:element name="get-bulk-config" substitutionGroup="rpcOperation">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="rpcOperation-Type">
          <xs:sequence>
            <xs:element ref="source" />
            <xs:element name="filter" minOccurs="0">
              <xs:complexType>
                <xs:sequence minOccurs="0" maxOccurs="1">
                  <xs:any maxOccurs="1" namespace="##other" processContents="strict"></xs:any>
                </xs:sequence>
                <xs:attribute name="type" >
                  <xs:simpleType>
                    <xs:restriction base="xs:string">
                      <xs:enumeration value="subtree"/>
                    </xs:restriction>
                  </xs:simpleType>
                </xs:attribute>
                <xs:anyAttribute namespace="urn:ietf:params:xml:ns:netconf:base:1.0" processContents="strict"></xs:anyAttribute>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>

  <!--rpc\get definition-->
  <xs:element name="get" substitutionGroup="rpcOperation">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="rpcOperation-Type">
          <xs:sequence>
            <xs:element name="filter" minOccurs="0">
              <xs:complexType>
                <xs:choice minOccurs="0">
                  <xs:any maxOccurs="1" namespace="##other" processContents="strict"></xs:any>
                  <xs:any maxOccurs="1" namespace="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring" processContents="strict"></xs:any>
                  <xs:any maxOccurs="1" namespace="urn:ietf:params:xml:ns:netmod:notification" processContents="strict"></xs:any>
                </xs:choice>
                <xs:attribute name="type">
                  <xs:simpleType>
                    <xs:restriction base="xs:string">
                      <xs:enumeration value="subtree"/>
                    </xs:restriction>
                  </xs:simpleType>
                </xs:attribute>
                <xs:anyAttribute namespace="urn:ietf:params:xml:ns:netconf:base:1.0" processContents="strict" ></xs:anyAttribute>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>


  <!--rpc\get-bulk definition-->
  <xs:element name="get-bulk" substitutionGroup="rpcOperation">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="rpcOperation-Type">
          <xs:sequence>
            <xs:element name="filter" minOccurs="0">
              <xs:complexType>
                <xs:sequence minOccurs="0">
                  <xs:any maxOccurs="1" namespace="##other" processContents="strict"></xs:any>
                </xs:sequence>
                <xs:attribute name="type">
                  <xs:simpleType>
                    <xs:restriction base="xs:string">
                      <xs:enumeration value="subtree"/>
                    </xs:restriction>
                  </xs:simpleType>
                </xs:attribute>
                <xs:anyAttribute namespace="urn:ietf:params:xml:ns:netconf:base:1.0" processContents="strict" ></xs:anyAttribute>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>

  <!--rpc\edit-config definition-->
  <xs:element name="edit-config" substitutionGroup="rpcOperation">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="rpcOperation-Type">
          <xs:sequence>
            <xs:element ref="target" />
            <xs:element name="default-operation" minOccurs="0">
              <xs:simpleType>
                <xs:restriction base="xs:string">
                  <xs:enumeration value="merge"/>
                  <xs:enumeration value="replace"/>
                  <xs:enumeration value="none"/>
                </xs:restriction>
              </xs:simpleType>
            </xs:element>
            <xs:element name="test-option" minOccurs="0">
              <xs:simpleType>
                <xs:restriction base="xs:string">
                  <xs:enumeration value="test-then-set"/>
                  <xs:enumeration value="set"/>
                  <xs:enumeration value="test-only"/>
                </xs:restriction>
              </xs:simpleType>
            </xs:element>
            <xs:element name="error-option" minOccurs="0">
              <xs:simpleType>
                <xs:restriction base="xs:string">
                  <xs:enumeration value="continue-on-error"/>
                  <xs:enumeration value="stop-on-error"/>
                  <xs:enumeration value="rollback-on-error"/>
                </xs:restriction>
              </xs:simpleType>
            </xs:element>
            <xs:element name="config">
              <xs:complexType>
                <xs:sequence>
                  <xs:any maxOccurs="1" namespace="##other" processContents="strict"></xs:any>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>

  <!--rpc\action definition-->
  <xs:element name="action" substitutionGroup="rpcOperation">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="rpcOperation-Type">
          <xs:sequence>
            <xs:element name="error-option" minOccurs="0">
              <xs:simpleType>
                <xs:restriction base="xs:string">
                  <xs:enumeration value="continue-on-error"/>
                  <xs:enumeration value="stop-on-error"/>
                </xs:restriction>
              </xs:simpleType>
            </xs:element>
            <xs:any maxOccurs="1" namespace="##other" processContents="strict"></xs:any>
          </xs:sequence>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>


  <!--rpc\kill-session definition-->
  <xs:element name="kill-session" substitutionGroup="rpcOperation">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="rpcOperation-Type">
          <xs:sequence>
            <xs:element name="session-id" type="xs:unsignedInt" />
          </xs:sequence>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>

  <!--rpc\lock definition-->
  <xs:element name="lock" substitutionGroup="rpcOperation">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="rpcOperation-Type">
          <xs:sequence>
            <xs:element ref="target" />
          </xs:sequence>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>

  <!--rpc\lock definition-->
  <xs:element name="get-sessions" substitutionGroup="rpcOperation">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="rpcOperation-Type">
          <xs:sequence>
          </xs:sequence>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>

  <!--rpc\unlock definition-->
  <xs:element name="unlock" substitutionGroup="rpcOperation">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="rpcOperation-Type">
          <xs:sequence>
            <xs:element ref="target" />
          </xs:sequence>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>

  <!--rpc\load definition-->
  <xs:element name="load" substitutionGroup="rpcOperation">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="rpcOperation-Type">
          <xs:sequence>
            <xs:element name="file">
              <xs:simpleType >
                <xs:restriction base="xs:string">
                  <xs:maxLength value ="220" />
                  <xs:pattern value ="^[^/ ][^ ]*\.cfg$" />
                </xs:restriction>
              </xs:simpleType>
            </xs:element>
          </xs:sequence>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>

  <!--rpc\save definition-->
  <xs:element name="save" substitutionGroup="rpcOperation">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="rpcOperation-Type">
          <xs:sequence>
            <xs:element name="file" minOccurs="0" >
              <xs:simpleType >
                <xs:restriction base="xs:string">
                  <xs:maxLength value ="220" />
                  <xs:pattern value ="^[^/ ][^ ]*\.cfg$" />
                </xs:restriction>
              </xs:simpleType>
            </xs:element>
          </xs:sequence>
          <xs:attribute name="OverWrite" type="xs:boolean"/>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>

  <!--rpc\rollback definition-->
  <xs:element name="rollback" substitutionGroup="rpcOperation">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="rpcOperation-Type">
          <xs:sequence>
            <xs:element name="file" >
              <xs:simpleType >
                <xs:restriction base="xs:string">
                  <xs:maxLength value ="220" />
                  <xs:pattern value ="^[^/ ][^ ]*\.cfg$" />
                </xs:restriction>
              </xs:simpleType>
            </xs:element>
          </xs:sequence>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>

  <!--rpc\close-session definition-->
  <xs:element name="close-session" substitutionGroup="rpcOperation">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="rpcOperation-Type">
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>

  <xs:simpleType name ="_CLI_CONTENT_TYPE_">
    <xs:restriction base="xs:string">
      <xs:minLength value="1"></xs:minLength>
      <xs:maxLength value="65535"></xs:maxLength>
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="CliContentType">
    <xs:simpleContent>
      <xs:extension base="_CLI_CONTENT_TYPE_">
        <xs:attribute name="exec-use-channel" >
          <xs:simpleType>
            <xs:restriction base="xs:string">
              <xs:enumeration value="true"></xs:enumeration>
              <xs:enumeration value="false"></xs:enumeration>
              <xs:enumeration value="persist"></xs:enumeration>
            </xs:restriction>
          </xs:simpleType>
        </xs:attribute>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>

  <!--rpc\CLI definition-->
  <xs:element name="CLI" substitutionGroup="rpcOperation">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="rpcOperation-Type">
          <xs:all>
            <xs:element name="Configuration" minOccurs="0" type="CliContentType"  >
            </xs:element>
            <xs:element name="Execution" minOccurs="0" >
              <xs:simpleType>
                <xs:restriction base="xs:string">
                  <xs:minLength value="1"></xs:minLength>
                  <xs:maxLength value="65535"></xs:maxLength>
                </xs:restriction>
              </xs:simpleType>
            </xs:element>
            <xs:element name="Open-channel" minOccurs="0"  type="xs:string" fixed="">
            </xs:element>
            <xs:element name="Close-channel" minOccurs="0"  type="xs:string" fixed="" >
            </xs:element>
          </xs:all>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  
  <!--hello definition-->
  <xs:element name="hello">
    <xs:complexType >
      <xs:sequence >
        <xs:element name="capabilities">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="capability" type="xs:string" minOccurs="1" maxOccurs="unbounded">
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:anyAttribute processContents="skip"></xs:anyAttribute>
    </xs:complexType>
  </xs:element>
  
  <!--copy-config definition-->
  <xs:element name="copy-config" substitutionGroup="rpcOperation">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="rpcOperation-Type">
          <xs:sequence>
            <xs:element ref="target" />
            <xs:element ref="source" />
          </xs:sequence>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  
  <!--delete-config definition-->
  <xs:element name="delete-config" substitutionGroup="rpcOperation">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="rpcOperation-Type">
          <xs:sequence>
            <xs:element ref="target" />
          </xs:sequence>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  
  <!--validate definition-->
  <xs:element name="validate" substitutionGroup="rpcOperation">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="rpcOperation-Type">
          <xs:sequence>
            <xs:element name="source" >
              <xs:complexType>
                <xs:choice>
                  <!--  <xs:element ref="config-name"/>  -->
                  <!--  <xs:element name="url" type="configURIType"/>  -->
                  <xs:element name="config">
                    <xs:complexType>
                      <xs:sequence>
                        <xs:element ref="config-child" />
                      </xs:sequence>
                    </xs:complexType>
                  </xs:element>
                  <!--
                  <xs:element name="action">
                    <xs:complexType>
                      <xs:sequence>
                        <xs:element ref="action-child" />
                      </xs:sequence>
                    </xs:complexType>
                  </xs:element>
                  -->
                </xs:choice>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  
  <!--SavePoint definition-->
  <xs:element name="save-point" substitutionGroup="rpcOperation">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="rpcOperation-Type">
          <xs:choice>
            <xs:element name="begin" >
              <xs:complexType>
                <xs:choice minOccurs="0">
                  <xs:element name="confirm-timeout">
                    <xs:simpleType >
                      <xs:restriction base="xs:integer">
                        <xs:minInclusive value="1"></xs:minInclusive>
                        <xs:maxInclusive value="65535"></xs:maxInclusive>
                      </xs:restriction>
                    </xs:simpleType>
                  </xs:element>
                </xs:choice>
              </xs:complexType>
            </xs:element>
            <xs:element name="end" type="xs:string" fixed=""/>
            <xs:element name="commit" >
              <xs:complexType>
                <xs:all minOccurs="0">
                  <xs:element name="label" minOccurs="0" maxOccurs="1">
                    <xs:simpleType >
                      <xs:restriction base="xs:string">
                        <xs:minLength value="1"></xs:minLength>
                        <xs:maxLength value="64"></xs:maxLength>
                      </xs:restriction>
                    </xs:simpleType>
                  </xs:element>
                  <xs:element name="comment" minOccurs="0" maxOccurs="1">
                    <xs:simpleType >
                      <xs:restriction base="xs:string">
                        <xs:minLength value="1"></xs:minLength>
                        <xs:maxLength value="512"></xs:maxLength>
                      </xs:restriction>
                    </xs:simpleType>
                  </xs:element>
                </xs:all>
                <xs:attribute name ="force"  use="optional" type="xs:boolean">
                </xs:attribute>
              </xs:complexType>
            </xs:element>
            <xs:element name="rollback">
              <xs:complexType>
                <xs:choice minOccurs="0" >
                  <xs:element name="commit-id" >
                    <xs:simpleType >
                      <xs:restriction base="xs:unsignedInt">
                        <xs:minInclusive value="1"></xs:minInclusive>
                        <xs:maxInclusive value="4294967294"></xs:maxInclusive>
                      </xs:restriction>
                    </xs:simpleType>
                  </xs:element>
                  <xs:element name="commit-index" >
                    <xs:simpleType >
                      <xs:restriction base="xs:integer">
                        <xs:minInclusive value="0"></xs:minInclusive>
                        <xs:maxInclusive value="49"></xs:maxInclusive>
                      </xs:restriction>
                    </xs:simpleType>
                  </xs:element>
                  <xs:element name="commit-label">
                    <xs:simpleType >
                      <xs:restriction base="xs:string">
                        <xs:minLength value="1"></xs:minLength>
                        <xs:maxLength value="64"></xs:maxLength>
                      </xs:restriction>
                    </xs:simpleType>
                  </xs:element>
                </xs:choice>
              </xs:complexType>
            </xs:element>
            <xs:element name="get-commits" >
              <xs:complexType>
                <xs:choice minOccurs="0"  maxOccurs="1">
                  <xs:element name="commit-id" >
                    <xs:simpleType >
                      <xs:restriction base="xs:unsignedInt">
                        <xs:minInclusive value="1"></xs:minInclusive>
                        <xs:maxInclusive value="4294967294"></xs:maxInclusive>
                      </xs:restriction>
                    </xs:simpleType>
                  </xs:element>
                  <xs:element name="commit-index"  >
                    <xs:simpleType >
                      <xs:restriction base="xs:integer">
                        <xs:minInclusive value="0"></xs:minInclusive>
                        <xs:maxInclusive value="49"></xs:maxInclusive>
                      </xs:restriction>
                    </xs:simpleType>
                  </xs:element>
                  <xs:element name="commit-label">
                    <xs:simpleType >
                      <xs:restriction base="xs:string">
                        <xs:minLength value="1"></xs:minLength>
                        <xs:maxLength value="64"></xs:maxLength>
                      </xs:restriction>
                    </xs:simpleType>
                  </xs:element>
                </xs:choice>
              </xs:complexType>
            </xs:element>
            <xs:element name="get-commit-information">
              <xs:complexType>
                <xs:sequence minOccurs="0" >
                  <xs:element name="commit-information">
                    <xs:complexType>
                      <xs:choice>
                        <xs:element name="commit-id">
                        <xs:simpleType >
                          <xs:restriction base="xs:unsignedInt">
                            <xs:minInclusive value="1"></xs:minInclusive>
                            <xs:maxInclusive value="4294967294"></xs:maxInclusive>
                          </xs:restriction>
                        </xs:simpleType>
                      </xs:element>
                        <xs:element name="commit-index" >
                          <xs:simpleType >
                            <xs:restriction base="xs:integer">
                              <xs:minInclusive value="0"></xs:minInclusive>
                              <xs:maxInclusive value="49"></xs:maxInclusive>
                            </xs:restriction>
                          </xs:simpleType>
                        </xs:element>
                        <xs:element name="commit-label">
                          <xs:simpleType >
                            <xs:restriction base="xs:string">
                              <xs:minLength value="1"></xs:minLength>
                              <xs:maxLength value="64"></xs:maxLength>
                            </xs:restriction>
                          </xs:simpleType>
                        </xs:element>
                      </xs:choice>
                    </xs:complexType>
                  </xs:element>
                  <xs:element name="compare-information" minOccurs="0">
                    <xs:complexType>
                      <xs:choice >
                        <xs:element name="commit-id" >
                        <xs:simpleType >
                          <xs:restriction base="xs:unsignedInt">
                            <xs:minInclusive value="1"></xs:minInclusive>
                            <xs:maxInclusive value="4294967294"></xs:maxInclusive>
                          </xs:restriction>
                        </xs:simpleType>
                      </xs:element>
                        <xs:element name="commit-index">
                          <xs:simpleType >
                            <xs:restriction base="xs:integer">
                              <xs:minInclusive value="0"></xs:minInclusive>
                              <xs:maxInclusive value="49"></xs:maxInclusive>
                            </xs:restriction>
                          </xs:simpleType>
                        </xs:element>
                        <xs:element name="commit-label">
                          <xs:simpleType >
                            <xs:restriction base="xs:string">
                              <xs:minLength value="1"></xs:minLength>
                              <xs:maxLength value="64"></xs:maxLength>
                            </xs:restriction>
                          </xs:simpleType>
                        </xs:element>
                      </xs:choice>
                    </xs:complexType>
                  </xs:element>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:choice>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>

  <!--rpc\config-provisioned definition-->
  <xs:element name="config-provisioned" substitutionGroup="rpcOperation">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="rpcOperation-Type">
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
</xs:schema>