<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE schema SYSTEM "http://www.w3.org/2001/XMLSchema.dtd">

<xsd:schema
  xmlns:xsd='http://www.w3.org/2001/XMLSchema'
  targetNamespace='http://www.muonics.com/XMLSMI/Schema/XML-SMI-2.1'
  xmlns:smi='http://www.muonics.com/XMLSMI/Schema/XML-SMI-2.1'
  elementFormDefault='qualified'>

 <xsd:annotation>
  <xsd:documentation>

   This document describes the proposed XML Schema for XML-Based SMI/ASN.1
   Module Representation developed by Michael Kirkham/Muonics.  The schema
   based loosely on the original draft-irtf-nmrg-smi-xml-00.txt DTD by
   J. Schoenwaelder and F. Strauss.

   This schema corrects many of the problems in the original DTD
   (such as lack of specified patterns for various items, misplaced
   imports, etc.) as well as a greater flexibility in supporting
   XML as an "input" format (as opposed to only a back-end format
   generated by a compiler) -or- an output format, and in supporting
   other types of modules such as the SMI base modules, older SMIv1
   modules, and generic ASN.1 modules (though some work remains to
   be done in the latter area).  This schema also adds support for
   many legally-valid constructs from the SMI, such as "module.descriptor"
   forms for type and value references, that the original DTD
   provided no obvious mechanisms for and that many compilers lack
   support for.

   The most significant difference that should be noted, other than the
   above and some different naming conventions, is that this schema uses
   a flat model (same as with normal non-XML format modules) for
   describing items with values (such as OBJECT-TYPEs etc.), rather than
   a heirarchical one with different structures for scalars, tables,
   rows and columns.  The reason for this difference is to allow the
   format to be used as an "input" or "working" format where not all
   information may yet be defined/available in order to determine such
   relationships, as well as to simplify conversion of OIDs from relative
   to absolute forms using XPath.

   See the end of this document for a list of revisions.

  </xsd:documentation>
 </xsd:annotation>

 <!-- =============================================================== -->
 <!-- Root element definition for an SMI Module List in XML.          -->
 <!-- =============================================================== -->

 <xsd:element name='smi' type='smi:ModuleList'/>

 <xsd:complexType name='ModuleList'>
  <xsd:sequence>
   <xsd:element name='module' type='smi:ModuleDefinition' maxOccurs='unbounded'/>
  </xsd:sequence>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'MixedText' type used for all quoted-string text fields     -->
 <!-- such as DESCRIPTION, etc., and comments, allows for additional  -->
 <!-- elements to specify formatting markup.  The "pre" element       -->
 <!-- may be used to specify that the contained text is pre-formatted -->
 <!-- and should not be joined or word-wrapped (although all lines    -->
 <!-- may be shifted an equal amount to absorb indentation that is    -->
 <!-- present only for readability of the XML file).  All other text  -->
 <!-- including that in the "para" elements should be stripped of     -->
 <!-- newlines and extra whitespace, joined at newlines, and then     -->
 <!-- word-wrapped appropriately for display/conversion/etc.  The     -->
 <!-- "br" element may be used to force a line break where text would -->
 <!-- otherwise be joined.  In the future, this type should also      -->
 <!-- allow markup for ordered/unordered lists and tables.            -->
 <!-- =============================================================== -->

 <xsd:complexType name='MixedText' mixed='true'>
  <xsd:choice minOccurs='0' maxOccurs='unbounded'>

   <!-- Use br to force a linebreak within a paragraph.               -->
   <xsd:element name='br' type='smi:LineBreak'/>

   <!-- Pre-Formatted Text (though possibly indented) -->
   <xsd:element name='pre' type='xsd:string'/>

   <!-- Paragraph Text (should be joined at newlines/wordwrapped)     -->
   <xsd:element name='para'>
    <xsd:complexType mixed='true'>
     <xsd:sequence>

      <!-- Use br to force a linebreak within a paragraph.            -->
      <xsd:element name='br' type='smi:LineBreak' minOccurs='0' maxOccurs='unbounded'/>
     </xsd:sequence>
    </xsd:complexType>
   </xsd:element>

  </xsd:choice>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- Forced Line Break for MixedText.  No subelements are allowed.   -->
 <!-- =============================================================== -->

 <xsd:complexType name='LineBreak'>
  <xsd:complexContent mixed='false'>
   <xsd:restriction base="xsd:anyType"/>
  </xsd:complexContent>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'Identifier' type specifies any sequence of characters that -->
 <!-- are allowed in ASN.1 for an identifier such as a type, value or -->
 <!-- module reference.                                               -->
 <!-- =============================================================== -->

 <xsd:simpleType name='Identifier'>
  <xsd:restriction base='xsd:string'>
   <xsd:pattern value='[a-zA-Z](-?[a-zA-Z0-9])*'/>
  </xsd:restriction>
 </xsd:simpleType>

 <!-- =============================================================== -->
 <!-- The 'LCIdentifier' type specifies any sequence of characters    -->
 <!-- are allowed in ASN.1 for any identifier that is allowed for     -->
 <!-- a value reference (e.g. a lowercase-first-letter identifier).   -->
 <!-- =============================================================== -->

 <xsd:simpleType name='LCIdentifier'>
  <xsd:restriction base='smi:Identifier'>
   <xsd:pattern value='[a-z](-?[a-zA-Z0-9])*'/>
  </xsd:restriction>
 </xsd:simpleType>

 <!-- =============================================================== -->
 <!-- The 'UCIdentifier' type specifies any sequence of characters    -->
 <!-- are allowed in ASN.1 for any identifier that is allowed for     -->
 <!-- a type reference (e.g. an uppercase-first-letter identifier).   -->
 <!-- =============================================================== -->

 <xsd:simpleType name='UCIdentifier'>
  <xsd:restriction base='smi:Identifier'>
   <xsd:pattern value='[A-Z](-?[a-zA-Z0-9])*'/>
  </xsd:restriction>
 </xsd:simpleType>

 <!-- =============================================================== -->
 <!-- The 'TypeName' type specifies any sequence of characters that   -->
 <!-- are allowed in ASN.1 for a type.  This includes the normal      -->
 <!-- 'UCIdentifier' values as well as some types that contain more   -->
 <!-- than one word (such as "OBJECT IDENTIFIER" or "OCTET STRING").  -->
 <!-- =============================================================== -->

 <xsd:simpleType name='TypeName'>
  <xsd:restriction base='xsd:string'>
   <xsd:pattern value='([A-Z](-?[a-zA-Z0-9])*)|(SEQUENCE OF)|(SET OF)|(OCTET STRING)|(OBJECT IDENTIFIER)|(BIT STRING)|(ANY DEFINED BY)'/>
  </xsd:restriction>
 </xsd:simpleType>

 <!-- =============================================================== -->
 <!-- The 'OIDValue type is used to specify an OBJECT IDENTIFIER      -->
 <!-- value.  Each subidentifier is given as a single subelement in   -->
 <!-- order to allow both flexibility in preserving all "as-written"  -->
 <!-- information from the ASN.1 module (such as the name for         -->
 <!-- a name-and-number subidentifier form), as well as to simplify   -->
 <!-- conversion in cases where only certain properties are needed.   -->
 <!-- All implementations must use the 'subid' form.  Implementations -->
 <!-- may optionally use the 'value' attribute to specify an absolute -->
 <!-- OID value, when the complete OID can be resolved all the way    -->
 <!-- to one of the three root nodes, to aid lookups by OID.          -->
 <!-- =============================================================== -->

 <xsd:complexType name='OIDValue'>
  <xsd:sequence>
   <xsd:element name='subid' type='smi:SubIdentifier' maxOccurs='unbounded'/>
  </xsd:sequence>
  <xsd:attribute name='value' use='optional'>
   <xsd:simpleType>
    <xsd:restriction base='xsd:string'>
     <xsd:pattern value='[0-2](\.(0|[1-9][0-9]*))+'/>
    </xsd:restriction>
   </xsd:simpleType>
  </xsd:attribute>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'SubIdentifier' type is used to specify an individual       -->
 <!-- subidentifier in an OBJECT IDENTIFIER value.  Four forms are    -->
 <!-- allowed: module + name (for modulereference.valuereference      -->
 <!-- form), name only, name + module (for name(value) form), and     -->
 <!-- value only.  At least the name OR value MUST be specified.      -->
 <!-- =============================================================== -->

 <xsd:complexType name='SubIdentifier'>
  <!-- At least name or value MUST be present. -->
  <xsd:attribute name='name' type='smi:LCIdentifier' use='optional'/>
  <xsd:attribute name='value' type='xsd:nonNegativeInteger' use='optional'/>
  <xsd:attribute name='module' type='smi:UCIdentifier' use='optional'/>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'DisplayHint' type is used to specify the "DISPLAY-HINT"    -->
 <!-- property for a TEXTUAL-CONVENTION.  It provides a basic pattern -->
 <!-- for determining whether the value specified is a valid sequence -->
 <!-- of formatting rules.  This pattern is NOT exhaustive: in        -->
 <!-- particular, it does not check whether or not a repeat           -->
 <!-- terminator flag is coupled with a preceding repeat indicator.   -->
 <!-- =============================================================== -->

 <xsd:simpleType name='DisplayHint'>
  <xsd:restriction base='xsd:string'>
   <xsd:pattern value='[xob]|(d(-[0-9]+)?)|((\*?[0-9]+[xdoat][^0-9\*]{0,2})+)'/>
  </xsd:restriction>
 </xsd:simpleType>

 <!-- =============================================================== -->
 <!-- The 'ExtUTCTime' type is used to specify time stamps used in    -->
 <!-- the LAST-UPDATED and REVISION properties of a MODULE-IDENITTY.  -->
 <!-- It provides a basic pattern for determining whether or not the  -->
 <!-- value specified corresponds to an ExtUTCTime value according to -->
 <!-- RFC 2578.  Note that this pattern does not provide any range    -->
 <!-- checking (e.g. that the hours field is between 00 - 23).  It is -->
 <!-- up to an implementation to do these checks if necessary.        -->
 <!-- =============================================================== -->

 <xsd:simpleType name='ExtUTCTime'>
  <xsd:restriction base='xsd:string'>
    <xsd:pattern value='[0-9]{10}([0-9]{2})?Z'/>
  </xsd:restriction>
 </xsd:simpleType>

 <!-- =============================================================== -->
 <!-- The 'DefaultValue' type is used to specify values for the       -->
 <!-- DEFVAL properties of OBJECT-TYPEs and VARIATIONs.               -->
 <!-- =============================================================== -->

 <xsd:complexType name='DefaultValue'>
  <xsd:choice>
   <xsd:element name='oid' type='smi:OIDValue'/>      <!-- SMIv1 Only -->
   <xsd:element name='hstring' type='smi:HexString'/>
   <xsd:element name='bstring' type='smi:BinaryString'/>
   <xsd:element name='cstring' type='xsd:string'/>
   <xsd:element name='integer' type='xsd:integer'/>
   <xsd:element name='identifier' type='smi:LCIdentifier'/>
   <xsd:element name='idlist'>
    <xsd:complexType>
     <xsd:sequence>
      <xsd:element name="identifier" type='smi:LCIdentifier' minOccurs='0' maxOccurs='unbounded'/>
     </xsd:sequence>
    </xsd:complexType>
   </xsd:element>
  </xsd:choice>
 </xsd:complexType>

 <xsd:simpleType name='HexString'>
  <xsd:restriction base='xsd:string'>
    <xsd:pattern value='([0-9a-fA-F]{2})*'/>
  </xsd:restriction>
 </xsd:simpleType>

 <xsd:simpleType name='BinaryString'>
  <xsd:restriction base='xsd:string'>
    <xsd:pattern value='([01]{8})*'/>
  </xsd:restriction>
 </xsd:simpleType>

 <!-- =============================================================== -->
 <!-- The 'ObjectAccess' type is used to specify an access level for  -->
 <!-- an object as in MAX-ACCESS, MIN-ACCESS and ACCESS fields for    -->
 <!-- appropriate macros and clauses.  The values are specified as    -->
 <!-- they are in the SMI.                                            -->
 <!-- =============================================================== -->

 <xsd:simpleType name='ObjectAccess'>
  <xsd:restriction base='xsd:string'>
   <!-- SMIv1/v2 OBJECT-TYPE ACCESS/MAX-ACCESS Values -->
   <xsd:enumeration value='not-accessible'/>
   <xsd:enumeration value='accessible-for-notify'/>
   <xsd:enumeration value='read-only'/>
   <xsd:enumeration value='read-write'/>
   <xsd:enumeration value='read-create'/>
   <xsd:enumeration value='write-only'/>

   <!-- COPS-PR-SPPI OBJECT-TYPE PIB-ACCESS Values -->
   <xsd:enumeration value='install'/>
   <xsd:enumeration value='notify'/>
   <xsd:enumeration value='install-notify'/>
   <xsd:enumeration value='report-only'/>
  </xsd:restriction>
 </xsd:simpleType>

 <!-- =============================================================== -->
 <!-- The 'ValueReference' type is used to reference any definition   -->
 <!-- that has an OBJECT IDENTIFIER value assigned to it.  This may   -->
 <!-- either be a multi-component OID value, a simple LCIdentifier    -->
 <!-- value reference, or a module reference and a value reference    -->
 <!-- (for "modulereference.valuereference" forms from ASN.1).        -->
 <!-- Either the 'oid' element OR the 'name' attribute MUST be        -->
 <!-- present.  Under normal circumstances, the 'name' attribute      -->
 <!-- will be used, unless for some reason the reference is specified -->
 <!-- by OID instead of by name, through an odd quirk of the          -->
 <!-- ambiguous SMI macros, where it is possible to specify an OIDs   -->
 <!-- instead of descriptors in, for example, a notification's        -->
 <!-- OBJECTS list. Most compilers do not OID values in these places, -->
 <!-- so encountering them here should be rare, however some (e.g.    -->
 <!-- Muonics' MIB Smithy) can handle them and may generate them in   -->
 <!-- the XML file if specified in OID form.                          -->
 <!-- =============================================================== -->

 <xsd:complexType name='ValueReference'>
  <xsd:sequence>
   <xsd:element name='oid' type='smi:OIDValue' minOccurs='0'/>
  </xsd:sequence>
  <xsd:attribute name='module' type='smi:UCIdentifier' use='optional'/>
  <xsd:attribute name='name' type='smi:LCIdentifier' use='optional'/>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'ModuleDefinition' type is used to define an individual     -->
 <!-- module definition, its properties, and the definitions that it  -->
 <!-- contains.  Normally this will be a MIB module, although steps   -->
 <!-- have been taken in this schema to allow SMI base modules and    -->
 <!-- (more generally) ASN.1 modules to be mapped as well.  One or    -->
 <!-- more instances of this type will appear immediately below the   -->
 <!-- 'smi' root element depending on the number of modules defined   -->
 <!-- in an individual file.  The 'oid', 'exports', and 'macros'      -->
 <!-- elements and the 'tags' attribute are provided for              -->
 <!-- compatibility with ASN.1 and older modules ONLY.  They are not  -->
 <!-- allowed in MIB modules, particularly in SMIv2.                  -->
 <!-- =============================================================== -->

 <xsd:complexType name='ModuleDefinition'>
  <xsd:sequence>
   <xsd:element name='comments' type='smi:MixedText' minOccurs='0'/>

 <!-- =============================================================== -->
 <!-- For compatibility with older modules/ASN.1 only.                -->
 <!-- =============================================================== -->
   <xsd:element name='oid' type='smi:OIDValue' minOccurs='0'/>
   <xsd:element name='exports' type='smi:ExportsList' minOccurs='0'/>
 <!-- =============================================================== -->

   <xsd:element name='imports' type='smi:ImportsList' minOccurs='0'/>
   <xsd:element name='typedefs' type='smi:TypedefsList' minOccurs='0'/>

 <!-- =============================================================== -->
 <!-- For compatibility with older modules/ASN.1 only.                -->
 <!-- =============================================================== -->
   <xsd:element name='macros' type='smi:MacrosList' minOccurs='0'/>
 <!-- =============================================================== -->

   <xsd:element name='assignments' type='smi:AssignmentsList' minOccurs='0'/>
  </xsd:sequence>
  <xsd:attribute name='name' type='smi:UCIdentifier' use='required'/>
  <xsd:attribute name='language' use='optional'>
   <xsd:simpleType>
    <xsd:restriction base='xsd:string'>
     <xsd:enumeration value='SMIv1'/>
     <xsd:enumeration value='SMIv2'/>
     <xsd:enumeration value='COPS-PR-SPPI'/>
    </xsd:restriction>
   </xsd:simpleType>
  </xsd:attribute>

 <!-- =============================================================== -->
 <!-- For compatibility with older modules/ASN.1 only.                -->
 <!-- =============================================================== -->
  <xsd:attribute name='tags' default='explicit'>
   <xsd:simpleType>
    <xsd:restriction base='xsd:string'>
     <xsd:enumeration value='explicit'/>
     <xsd:enumeration value='implicit'/>
    </xsd:restriction>
   </xsd:simpleType>
  </xsd:attribute>
 <!-- =============================================================== -->
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'ImportsList' type contains a list of modules to import     -->
 <!-- symbols from, and those symbols.  This property corresponds     -->
 <!-- to the 'IMPORTS' section of an ASN.1 module.  Zero or more      -->
 <!-- instances of the 'importsfrom' element may be present, with     -->
 <!-- each one corresponding to a unique external module.  Care       -->
 <!-- should be taken to ensure that each module is referenced only   -->
 <!-- once, as they must be in ASN.1, though implementations are      -->
 <!-- encouraged to work around duplicate module references anyway.   -->
 <!-- =============================================================== -->

 <xsd:complexType name='ImportsList'>
  <xsd:sequence>
   <xsd:element name='importsfrom' type='smi:ImportsFrom' minOccurs='0' maxOccurs='unbounded'/>
  </xsd:sequence>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'ImportsFrom' type contains a list of symbols to import     -->
 <!-- from the specified module.  The 'module' attribute, which is    -->
 <!-- required, names either the actual module (if the 'oid' element  -->
 <!-- is not present) or the locally-known name for the module (if    -->
 <!-- the 'oid' element is present), which may be the same depending  -->
 <!-- on circumstances.  The 'oid' property may be used to specify    -->
 <!-- either the OID value for the module its self (if appearing in   -->
 <!-- a normal ASN.1 module or if importing from an SMIv1 module)     -->
 <!-- or the OID for the module's MODULE-IDENTITY (if importing from  -->
 <!-- an SMIv2 module).  This OID value uniquely identifies the       -->
 <!-- imported module where its name might otherwise be ambiguous     -->
 <!-- due to importing two modules with the same name.  In such a     -->
 <!-- case, one (or both) of the imported modules may be referenced   -->
 <!-- locally by a different name and the OID used to determine the   -->
 <!-- actual module intended.  Note that many compilers/tools do not  -->
 <!-- support this aspect of ASN.1 and the SMI, so its use should be  -->
 <!-- avoided where possible.                                         -->
 <!-- =============================================================== -->

 <xsd:complexType name='ImportsFrom'>
  <xsd:sequence>
   <xsd:element name='oid' type='smi:OIDValue' minOccurs='0'/>
   <xsd:element name='import' type='smi:ImportSymbol' maxOccurs='unbounded'/>
  </xsd:sequence>
  <xsd:attribute name='module' type='smi:UCIdentifier' use='required'/>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'ImportSymbol' type specifies an individual symbol that is  -->
 <!-- to be imported from an external module.  SMI rules on what can, -->
 <!-- must, or must not be imported (e.g. "BITS" must not be) apply.  -->
 <!-- =============================================================== -->

 <xsd:complexType name='ImportSymbol'>
  <xsd:attribute name='symbol' type='smi:Identifier' use='required'/>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'ExportsList' type specifies a list of locally-defined      -->
 <!-- symbols that are to be exported (made available for importing   -->
 <!-- into another module).  This type is provided for compatibility  -->
 <!-- with ASN.1 and older modules ONLY.  In SMIv2, ALL definitions   -->
 <!-- are considered to be implicitly exported.                       -->
 <!-- =============================================================== -->

 <xsd:complexType name='ExportsList'>
  <xsd:sequence>
   <xsd:element name='export' type='smi:ExportSymbol' maxOccurs='unbounded'/>
  </xsd:sequence>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'ExportSymbol' type specifies an individual symbol that is  -->
 <!-- to be exported from this module.  This type is provided for     -->
 <!-- compatibility with ASN.1 and older modules ONLY.  In SMIv2, ALL -->
 <!-- definitions are considered to be implicitly exported.           -->
 <!-- =============================================================== -->

 <xsd:complexType name='ExportSymbol'>
  <xsd:attribute name='symbol' type='smi:Identifier' use='required'/>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'TypedefsList' type specifies a list of zero or more        -->
 <!-- derived types to be used by other definitions.  These may be    -->
 <!-- basic ASN.1 Type Assignments or SMIv2 TEXTUAL-CONVENTIONs.  The -->
 <!-- derived types are listed in a section separate from the other   -->
 <!-- (valued) assignments to aid in referencing via XLST etc.        -->
 <!-- =============================================================== -->

 <xsd:complexType name='TypedefsList'>
  <xsd:sequence>
   <xsd:element name='typedef' type='smi:Typedef' minOccurs='0' maxOccurs='unbounded'/>
  </xsd:sequence>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'Typedef' type defines an individual type assignment or     -->
 <!-- TEXTUAL-CONVENTION macro invocation.  One instance of this      -->
 <!-- structure is present for each derived type defined within the   -->
 <!-- module in which it is contained.                                -->
 <!-- =============================================================== -->

 <xsd:complexType name='Typedef'>
  <xsd:sequence>
   <xsd:element name='comments' type='smi:MixedText' minOccurs='0'/>
   <xsd:element name='syntax' type='smi:Syntax'/>
   <xsd:element name='format' type='smi:DisplayHint' minOccurs='0'/>
   <xsd:element name='description' type='smi:MixedText' minOccurs='0'/>
   <xsd:element name='reference' type='smi:MixedText' minOccurs='0'/>
  </xsd:sequence>
  <xsd:attribute name='name' type='smi:UCIdentifier' use='required'/>
  <xsd:attribute name='status' default='current'>
   <xsd:simpleType>
    <xsd:restriction base='xsd:string'>
     <xsd:enumeration value='current'/>
     <xsd:enumeration value='deprecated'/>
     <xsd:enumeration value='obsolete'/>
     <xsd:enumeration value='mandatory'/>
     <xsd:enumeration value='optional'/>
    </xsd:restriction>
   </xsd:simpleType>
  </xsd:attribute>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'MacrosList' type is intended to be used at some point to   -->
 <!-- allow macros to be specified within the XML document.  This is  -->
 <!-- for compatibility with SMI Base Modules/ASN.1 ONLY, as macros   -->
 <!-- may not legally be defined in management information modules.   -->
 <!-- The format for this structure is to be determined later.  It is -->
 <!-- provided here simply to indicate that it may exist at a later   -->
 <!-- time and that implementations should skip over all elements     -->
 <!-- under this type if they do not understand or support them.      -->
 <!-- (hence use of the 'xsd:anyType' type).                          -->
 <!-- =============================================================== -->

 <xsd:complexType name='MacrosList'>
  <xsd:sequence>
   <xsd:element name='macro' type='xsd:anyType' minOccurs='0' maxOccurs='unbounded'/>
  </xsd:sequence>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'AssignmentsList' type specifies a list of each definition  -->
 <!-- for which a value is assigned.  For management information      -->
 <!-- modules, this means OBJECT IDENTIFIER values only, such as      -->
 <!-- those from macro invocations (other than TEXTUAL-CONVENTION) as -->
 <!-- well as ASN.1 OID value assignments, which (in this schema)     -->
 <!-- take the same form as the OBJECT-IDENTITY ('objectid') element. -->
 <!--                                                                 -->
 <!-- Implementations are encouraged to place assignments in order of -->
 <!-- increasing OID value in order to be compatible with other       -->
 <!-- implementations that do not support forward references.  This   -->
 <!-- includes the 'moduleidentity' element, which in normal "ASN.1   -->
 <!-- like" format must appear first within the module.  This is not, -->
 <!-- however, a requirement since compiler implementations really    -->
 <!-- need to support forward references to be fully compliant.       -->
 <!--                                                                 -->
 <!-- The 'valuedef' element is reserved for future use in generic    -->
 <!-- ASN.1 module compatibility and its format remains to be defined -->
 <!-- (hence use of the 'xsd:anyType' type).  Implementations may     -->
 <!-- with to skip over any 'valuedef' elements if they are not       -->
 <!-- understood, although if they are present then it likely         -->
 <!-- indicates that the information contained in the module will     -->
 <!-- be incomplete without taking the valuedef information into      -->
 <!-- account.                                                        -->
 <!-- =============================================================== -->

 <xsd:complexType name='AssignmentsList'>
  <xsd:choice minOccurs='0' maxOccurs='unbounded'>
   <xsd:element name='moduleid' type='smi:ModuleIdentity'/>
   <xsd:element name='objectid' type='smi:ObjectIdentity'/>
   <xsd:element name='objecttype' type='smi:ObjectType'/>
   <xsd:element name='notification' type='smi:NotificationType'/>
   <xsd:element name='objectgroup' type='smi:ObjectGroup'/>
   <xsd:element name='notifygroup' type='smi:NotificationGroup'/>
   <xsd:element name='compliance' type='smi:ModuleCompliance'/>
   <xsd:element name='capability' type='smi:AgentCapabilities'/>

 <!-- =============================================================== -->
 <!-- RESERVED for compatibility with older modules/ASN.1 only.       -->
 <!-- =============================================================== -->
   <xsd:element name='valuedef' type='xsd:anyType'/>
 <!-- =============================================================== -->
  </xsd:choice>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'ModuleIdentity' type specifies an instance/invocation of   -->
 <!-- the MODULE-IDENITTY macro.  Exactly one instance of this type   -->
 <!-- should be present per SMIv2 management information module.      -->
 <!-- However, it is provided in this schema that there may be more   -->
 <!-- than one order to prevent information loss in the case a module -->
 <!-- (illegally) contains more than one, yet is converted to XML.    -->
 <!-- Also, this structure is placed in the same location as other    -->
 <!-- value assignments to aid in referencing in XSLT etc. in order   -->
 <!-- to convert relative OIDs to absolute OIDs, as it is not         -->
 <!-- uncommon for modules to assign OIDs under the MODULE-IDENTITY.  -->
 <!-- =============================================================== -->

 <xsd:complexType name='ModuleIdentity'>
  <xsd:sequence>
   <xsd:element name='comments' type='smi:MixedText' minOccurs='0'/>

   <!-- The COPS-PR-SPPI SUBJECT-CATEGORIES field.  If not present,   -->
   <!-- it should be taken to have the value 'all'.                   -->
   <xsd:element name='subjects' type='smi:Categories' minOccurs='0'/>

   <xsd:element name='organization' type='smi:MixedText' minOccurs='0'/>
   <xsd:element name='contact' type='smi:MixedText' minOccurs='0'/>
   <xsd:element name='description' type='smi:MixedText' minOccurs='0'/>
   <xsd:element name='revisions' type='smi:RevisionList' minOccurs='0'/>
   <xsd:element name='oid' type='smi:OIDValue'/>
  </xsd:sequence>
  <xsd:attribute name='name' type='smi:LCIdentifier' use='required'/>
  <xsd:attribute name='updated' type='smi:ExtUTCTime' use='required'/>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'RevisionList' type specifies a list of revisions of a      -->
 <!-- module of management information.  Zero or more instances of    -->
 <!-- the revision subelement may be present, each corresponding to   -->
 <!-- a REVISION clause from the SMIv2 MODULE-IDENTITY macro.  Each   -->
 <!-- revision SHOULD be listed in decreasing chronological order,    -->
 <!-- (particularly since this is a requirement of SMIv2).            -->
 <!-- =============================================================== -->

 <xsd:complexType name='RevisionList'>
  <xsd:sequence>
   <xsd:element name='revision' type='smi:Revision' minOccurs='0' maxOccurs='unbounded'/>
  </xsd:sequence>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'Revision' type specifies an individual revision listed     -->
 <!-- within a MODULE-IDENTITY statement.  The date attribute         -->
 <!-- indicates the date of the revision in ExtUTCTime format, as     -->
 <!-- with the MODULE-IDENTITY macro its self.                        -->
 <!-- =============================================================== -->

 <xsd:complexType name='Revision'>
  <xsd:sequence>
    <xsd:element name='description' type='smi:MixedText' minOccurs='0'/>
  </xsd:sequence>
  <xsd:attribute name='date' type='smi:ExtUTCTime' use='required'/>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'ObjectIdentity' type is used to define either an ASN.1     -->
 <!-- Value Assignment of type OBJECT IDENTIFIER or an instance of    -->
 <!-- the OBJECT-IDENTITY macro from SMIv2.  An instance of this      -->
 <!-- type should be considered an OBJECT-IDENTITY if the description -->
 <!-- or reference fields are present, or a value assignment if not.  -->
 <!-- (The difference between the two, of course, being that the      -->
 <!-- OBJECT-IDENTITY registers the OID and the value assignment does -->
 <!-- not.  See RFC 2578 section 3.6.)                                -->
 <!-- =============================================================== -->

 <xsd:complexType name='ObjectIdentity'>
  <xsd:sequence>
   <xsd:element name='comments' type='smi:MixedText' minOccurs='0'/>
   <xsd:element name='description' type='smi:MixedText' minOccurs='0'/>
   <xsd:element name='reference' type='smi:MixedText' minOccurs='0'/>
   <xsd:element name='oid' type='smi:OIDValue'/>
  </xsd:sequence>
  <xsd:attribute name='name' type='smi:LCIdentifier' use='required'/>
  <xsd:attribute name='status' default='current'>
   <xsd:simpleType>
    <xsd:restriction base='xsd:string'>
     <xsd:enumeration value='current'/>
     <xsd:enumeration value='deprecated'/>
     <xsd:enumeration value='obsolete'/>
    </xsd:restriction>
   </xsd:simpleType>
  </xsd:attribute>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'ObjectType' type is used to define an invocation of the    -->
 <!-- OBJECT-TYPE macro to define either a scalar or a conceptual     -->
 <!-- table, row, or columnar object as with OBJECT-TYPE.             -->
 <!-- =============================================================== -->

 <xsd:complexType name='ObjectType'>
  <xsd:sequence>
   <xsd:element name='comments' type='smi:MixedText' minOccurs='0'/>
   <xsd:element name='syntax' type='smi:Syntax'/>

   <!-- access element may only be present for tables in PIBs, but is -->
   <!-- required for all in MIBs.                                     -->

   <xsd:element name='access' type='smi:ObjectAccess' minOccurs='0'/>
   <xsd:element name='defval' type='smi:DefaultValue' minOccurs='0'/>
   <xsd:element name='units' type='xsd:string' minOccurs='0'/>
   <xsd:element name='description' type='smi:MixedText' minOccurs='0'/>
   <xsd:element name='reference' type='smi:MixedText' minOccurs='0'/>
   <xsd:choice minOccurs='0'>
    <xsd:element name='indices' type='smi:IndexList'/>
    <xsd:element name='augments' type='smi:ValueReference'/>
    <xsd:element name='extends' type='smi:ValueReference'/>
   </xsd:choice>
   <xsd:element name='pibindex' type='smi:ValueReference' minOccurs='0'/>
   <xsd:element name='piberrors' type='smi:EnumerationList' minOccurs='0'/>
   <xsd:element name='pibreference' type='smi:ValueReference' minOccurs='0'/>
   <xsd:element name='pibtag' type='smi:ValueReference' minOccurs='0'/>
   <xsd:element name='uniqueness' minOccurs='0'>
    <xsd:complexType>
     <xsd:sequence>
      <xsd:element name='column' type='smi:ValueReference' minOccurs='0' maxOccurs='unbounded'/>
     </xsd:sequence>
    </xsd:complexType>
   </xsd:element>
   <xsd:element name='oid' type='smi:OIDValue'/>
  </xsd:sequence>
  <xsd:attribute name='name' type='smi:LCIdentifier' use='required'/>
  <xsd:attribute name='status' default='current'>
   <xsd:simpleType>
    <xsd:restriction base='xsd:string'>
     <xsd:enumeration value='current'/>
     <xsd:enumeration value='deprecated'/>
     <xsd:enumeration value='obsolete'/>
     <xsd:enumeration value='mandatory'/>
     <xsd:enumeration value='optional'/>
    </xsd:restriction>
   </xsd:simpleType>
  </xsd:attribute>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'IndexList' type is used to specify the OBJECT-TYPE's       -->
 <!-- INDEX clause.  The 'implied' attribute, if true, indicates that -->
 <!-- the last object listed in the index is to be treated as in a    -->
 <!-- normal-format MIB module's index with the IMPLIED keyword.      -->
 <!-- Each 'index' element names the other objects, in order, that    -->
 <!-- are used to identify a specific instance of the indexed object. -->
 <!-- =============================================================== -->

 <xsd:complexType name='IndexList'>
  <xsd:sequence>
   <xsd:element name='index' type='smi:IndexItem' minOccurs='0' maxOccurs='unbounded'/>
  </xsd:sequence>
  <xsd:attribute name='implied' type='xsd:boolean' default='false'/>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'IndexItem' type is used to specify an individual indexing  -->
 <!-- object used to identify an specific instance of a MIB object in -->
 <!-- a table.  Either tha name OR type attributes OR the oid element -->
 <!-- MUST be specified.  Note that the type attribute is provided    -->
 <!-- for compatibility with SMIv1 ONLY.  SMIv1 allowed indexes to be -->
 <!-- specified by data type, while SMIv2 does not.  Also note that   -->
 <!-- most compilers do not support referencing index objects by OID  -->
 <!-- rather than by value, although technically allowed by a strict  -->
 <!-- reading of the OBJECT-TYPE macro productions.  Under normal     -->
 <!-- circumstances, the 'name' attribute will always be used, and    -->
 <!-- in rarer circumstances the 'module' attribute may also be       -->
 <!-- present to reference the object as in 'module.descriptor' form, -->
 <!-- which is also valid SMI but often unsupported by compilers.     -->
 <!-- =============================================================== -->

 <xsd:complexType name='IndexItem'>
  <xsd:sequence>
   <xsd:element name='oid' type='smi:OIDValue' minOccurs='0'/>
  </xsd:sequence>
  <xsd:attribute name='module' type='smi:UCIdentifier' use='optional'/>
  <xsd:attribute name='name' type='smi:LCIdentifier' use='optional'/>
  <xsd:attribute name='typeref' type='smi:TypeName' use='optional'/>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'NotificationType' type is used to define an invocation of  -->
 <!-- the NOTIFICATION-TYPE or TRAP-TYPE macro.  For purposes of this -->
 <!-- XML mapping, the TRAP-TYPE's value and enterprise are converted -->
 <!-- to the OID value as per RFC 2576 (Coexistance) rules regarding  -->
 <!-- mapping SMIv1 TRAP-TYPEs to SMIv2 NOTIFICATION-TYPEs.           -->
 <!-- =============================================================== -->

 <xsd:complexType name='NotificationType'>
  <xsd:sequence>
   <xsd:element name='comments' type='smi:MixedText' minOccurs='0'/>
   <xsd:element name='objects' minOccurs='0'>
    <xsd:complexType>
     <xsd:sequence>
      <xsd:element name='object' type='smi:ValueReference' minOccurs='0' maxOccurs='unbounded'/>
     </xsd:sequence>
    </xsd:complexType>
   </xsd:element>
   <xsd:element name='description' type='smi:MixedText' minOccurs='0'/>
   <xsd:element name='reference' type='smi:MixedText' minOccurs='0'/>
   <xsd:element name='oid' type='smi:OIDValue'/>
  </xsd:sequence>
  <xsd:attribute name='name' type='smi:LCIdentifier' use='required'/>
  <xsd:attribute name='status' default='current'>
   <xsd:simpleType>
    <xsd:restriction base='xsd:string'>
     <xsd:enumeration value='current'/>
     <xsd:enumeration value='deprecated'/>
     <xsd:enumeration value='obsolete'/>
     <xsd:enumeration value='mandatory'/>
     <xsd:enumeration value='optional'/>
    </xsd:restriction>
   </xsd:simpleType>
  </xsd:attribute>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'ObjectGroup' type is used to define an invocation of the   -->
 <!-- OBJECT-GROUP macro to specify a set of related MIB objects.     -->
 <!-- Note that while the 'ValueReference' type is used to identify   -->
 <!-- each member object, allowing either the normal 'LCIdentifier'   -->
 <!-- form or an OID value, the SMI rules that state that the groups  -->
 <!-- must be defined in the same module as the objects they include  -->
 <!-- still apply.                                                    -->
 <!-- =============================================================== -->

 <xsd:complexType name='ObjectGroup'>
  <xsd:sequence>
   <xsd:element name='comments' type='smi:MixedText' minOccurs='0'/>
   <xsd:element name='objects' minOccurs='0'>
    <xsd:complexType>
     <xsd:sequence>
      <xsd:element name='object' type='smi:ValueReference' minOccurs='0' maxOccurs='unbounded'/>
     </xsd:sequence>
    </xsd:complexType>
   </xsd:element>
   <xsd:element name='description' type='smi:MixedText' minOccurs='0'/>
   <xsd:element name='reference' type='smi:MixedText' minOccurs='0'/>
   <xsd:element name='oid' type='smi:OIDValue'/>
  </xsd:sequence>
  <xsd:attribute name='name' type='smi:LCIdentifier' use='required'/>
  <xsd:attribute name='status' default='current'>
   <xsd:simpleType>
    <xsd:restriction base='xsd:string'>
     <xsd:enumeration value='current'/>
     <xsd:enumeration value='deprecated'/>
     <xsd:enumeration value='obsolete'/>
    </xsd:restriction>
   </xsd:simpleType>
  </xsd:attribute>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'NotificationGroup' type is used to define an invocation of -->
 <!-- the NOTIFICATION-GROUP macro to specify a set of related        -->
 <!-- notifications.  Note that while the 'ValueReference' type is    -->
 <!-- used to identify each member object, allowing either the normal -->
 <!-- 'LCIdentifier' form or an OID value, the SMI rules that state   -->
 <!-- that the groups must be defined in the same module as the       -->
 <!-- notifications they include still apply.                         -->
 <!-- =============================================================== -->

 <xsd:complexType name='NotificationGroup'>
  <xsd:sequence>
   <xsd:element name='comments' type='smi:MixedText' minOccurs='0'/>
   <xsd:element name='notifications' minOccurs='0'>
    <xsd:complexType>
     <xsd:sequence>
      <xsd:element name='notification' type='smi:ValueReference' minOccurs='0' maxOccurs='unbounded'/>
     </xsd:sequence>
    </xsd:complexType>
   </xsd:element>
   <xsd:element name='description' type='smi:MixedText' minOccurs='0'/>
   <xsd:element name='reference' type='smi:MixedText' minOccurs='0'/>
   <xsd:element name='oid' type='smi:OIDValue'/>
  </xsd:sequence>
  <xsd:attribute name='name' type='smi:LCIdentifier' use='required'/>
  <xsd:attribute name='status' default='current'>
   <xsd:simpleType>
    <xsd:restriction base='xsd:string'>
     <xsd:enumeration value='current'/>
     <xsd:enumeration value='deprecated'/>
     <xsd:enumeration value='obsolete'/>
     <xsd:enumeration value='mandatory'/>
     <xsd:enumeration value='optional'/>
    </xsd:restriction>
   </xsd:simpleType>
  </xsd:attribute>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'ModuleCompliance' type is used to define an invocation of  -->
 <!-- the MODULE-COMPLIANCE macro to specify a set of requirements    -->
 <!-- for meeting a defined level of conformance to the MIB module.   -->
 <!-- Zero or more instances of the 'ComplianceModule' type may be    -->
 <!-- present listing each module required for compliance.  Note that -->
 <!-- the SMI requires at least one module to be present; however,    -->
 <!-- this structure allows an empty set in order to allow modules to -->
 <!-- be saved in this format that have not yet been fully defined.   -->
 <!-- =============================================================== -->

 <xsd:complexType name='ModuleCompliance'>
  <xsd:sequence>
   <xsd:element name='comments' type='smi:MixedText' minOccurs='0'/>
   <xsd:element name='description' type='smi:MixedText' minOccurs='0'/>
   <xsd:element name='reference' type='smi:MixedText' minOccurs='0'/>
   <xsd:element name='oid' type='smi:OIDValue'/>
   <xsd:element name='modules' minOccurs='0'>
    <xsd:complexType>
     <xsd:sequence>
      <xsd:element name='module' type='smi:ComplianceModule' minOccurs='0' maxOccurs='unbounded'/>
     </xsd:sequence>
    </xsd:complexType>
   </xsd:element>
  </xsd:sequence>
  <xsd:attribute name='name' type='smi:LCIdentifier' use='required'/>
  <xsd:attribute name='status' default='current'>
   <xsd:simpleType>
    <xsd:restriction base='xsd:string'>
     <xsd:enumeration value='current'/>
     <xsd:enumeration value='deprecated'/>
     <xsd:enumeration value='obsolete'/>
     <xsd:enumeration value='mandatory'/>
     <xsd:enumeration value='optional'/>
    </xsd:restriction>
   </xsd:simpleType>
  </xsd:attribute>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'ComplianceModule' type is used to specify a MIB module     -->
 <!-- that is required by the conformance level described by the      -->
 <!-- containing ModuleCompliance structure.  This type corresponds   -->
 <!-- to the 'MODULE' clause of the MODULE-COMPLIANCE macro.  The     -->
 <!-- name attribute, which indicates the name of the module, should  -->
 <!-- always be specified even if the name is the same as that of the -->
 <!-- module containing the MODULE-COMPLIANCE.  The 'oid' element     -->
 <!-- may be used to specify the OID value of the MODULE-IDENTITY of  -->
 <!-- the referenced module (as with the 'ModuleIdentifier' part of   -->
 <!-- the MODULE-COMPLIANCE's 'ModuleName' production) where the name -->
 <!-- of the module might otherwise be ambiguous.                     -->
 <!-- =============================================================== -->

 <xsd:complexType name='ComplianceModule'>
  <xsd:sequence>
   <xsd:element name='comments' type='smi:MixedText' minOccurs='0'/>
   <xsd:element name='oid' type='smi:OIDValue' minOccurs='0'/>
   <xsd:element name='requires' minOccurs='0'>
    <xsd:complexType>
     <xsd:sequence>
      <xsd:element name='group' type='smi:ValueReference' minOccurs='0' maxOccurs='unbounded'/>
     </xsd:sequence>
    </xsd:complexType>
   </xsd:element>
   <xsd:element name='groups' minOccurs='0'>
    <xsd:complexType>
     <xsd:sequence>
      <xsd:element name='group' type='smi:ComplianceGroup' minOccurs='0' maxOccurs='unbounded'/>
     </xsd:sequence>
    </xsd:complexType>
   </xsd:element>
   <xsd:element name='objects' minOccurs='0'>
    <xsd:complexType>
     <xsd:sequence>
      <xsd:element name='object' type='smi:ComplianceObject' minOccurs='0' maxOccurs='unbounded'/>
     </xsd:sequence>
    </xsd:complexType>
   </xsd:element>
  </xsd:sequence>
  <xsd:attribute name='name' type='smi:UCIdentifier' use='required'/>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'ComplianceGroup' type is used to specify a conditionally   -->
 <!-- required group in a MODULE-COMPLIANCE statement, corresponding  -->
 <!-- to that macro's GROUP clause.  Either the 'name' attribute OR   -->
 <!-- the 'oid' element MUST be present to identify the group.  Under -->
 <!-- most circumstances, the 'name' attribute will be used, as many  -->
 <!-- compiler implementations do not support referencing groups by   -->
 <!-- OID value within the GROUP clause, though technically allowed   -->
 <!-- by a strict reading of the macro's productions.                 -->
 <!-- =============================================================== -->

 <xsd:complexType name='ComplianceGroup'>
  <xsd:sequence>
   <xsd:element name='comments' type='smi:MixedText' minOccurs='0'/>
   <xsd:element name='oid' type='smi:OIDValue' minOccurs='0'/>
   <xsd:element name='description' type='smi:MixedText' minOccurs='0'/>
  </xsd:sequence>
  <xsd:attribute name='name' type='smi:LCIdentifier' use='optional'/>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'ComplianceObject' type is used to specify a variation for  -->
 <!-- a minimum level of conformance in a MODULE-COMPLIANCE           -->
 <!-- statement, corresponding to that macro's OBJECT clause.  Either -->
 <!-- the 'name' attribute OR the 'oid' element MUST be present to    -->
 <!-- identify the object.  Under most circumstances, the 'name'      -->
 <!-- attribute will be used, as many compiler implementations do not -->
 <!-- support referencing objects by OID value within the OBJECT      -->
 <!-- clause, though technically allowed by a strict reading of the   -->
 <!-- macro's productions.                                            -->
 <!-- =============================================================== -->

 <xsd:complexType name='ComplianceObject'>
  <xsd:sequence>
   <xsd:element name='comments' type='smi:MixedText' minOccurs='0'/>
   <xsd:element name='oid' type='smi:OIDValue' minOccurs='0'/>
   <!-- Use syntax for purposes of COPS-PR-SPPI's INSTALL-SYNTAX      -->
   <xsd:element name='syntax' type='smi:Syntax' minOccurs='0'/>
   <xsd:element name='writesyntax' type='smi:Syntax' minOccurs='0'/>
   <xsd:element name='minaccess' minOccurs='0'>
    <xsd:simpleType>
     <xsd:restriction base='xsd:string'>
      <!-- SMIv2 OBJECT variation MIN-ACCESS values -->
      <xsd:enumeration value='not-accessible'/>
      <xsd:enumeration value='accessible-for-notify'/>
      <xsd:enumeration value='read-only'/>
      <xsd:enumeration value='read-write'/>
      <xsd:enumeration value='read-create'/>

      <!-- COPS-PR-SPPI OBJECT variation PIB-MIN-ACCESS values.       -->
      <!-- Note that this also includes 'not-accessible'.             -->
      <xsd:enumeration value='install'/>
      <xsd:enumeration value='notify'/>
      <xsd:enumeration value='install-notify'/>
      <xsd:enumeration value='report-only'/>
     </xsd:restriction>
    </xsd:simpleType>
   </xsd:element>
   <xsd:element name='description' type='smi:MixedText' minOccurs='0'/>
  </xsd:sequence>
  <xsd:attribute name='name' type='smi:LCIdentifier' use='optional'/>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'AgentCapabilities' type is used to define an invocation of -->
 <!-- the AGENT-CAPABILITIES macro to specify the capabilities of an  -->
 <!-- individual implementation of the specified MIB module(s).       -->
 <!-- Zero or more instances of the 'CapabilityModule' type may be    -->
 <!-- present listing each module that is supported by the agent.     -->
 <!-- =============================================================== -->

 <xsd:complexType name='AgentCapabilities'>
  <xsd:sequence>
   <xsd:element name='comments' type='smi:MixedText' minOccurs='0'/>
   <xsd:element name='description' type='smi:MixedText' minOccurs='0'/>
   <xsd:element name='reference' type='smi:MixedText' minOccurs='0'/>
   <xsd:element name='oid' type='smi:OIDValue'/>
   <xsd:element name='modules' minOccurs='0'>
    <xsd:complexType>
     <xsd:sequence>
      <xsd:element name='module' type='smi:CapabilityModule' minOccurs='0' maxOccurs='unbounded'/>
     </xsd:sequence>
    </xsd:complexType>
   </xsd:element>
  </xsd:sequence>
  <xsd:attribute name='name' type='smi:LCIdentifier' use='required'/>
  <xsd:attribute name='release' type='xsd:string' use='required'/>
  <xsd:attribute name='status' default='current'>
   <xsd:simpleType>
    <xsd:restriction base='xsd:string'>
     <xsd:enumeration value='current'/>
     <xsd:enumeration value='obsolete'/>
    </xsd:restriction>
   </xsd:simpleType>
  </xsd:attribute>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'CapabilityModule' type is used to specify a MIB module     -->
 <!-- that is supported by the implementation described by the        -->
 <!-- containing AgentCapabilities structure.  This type corresponds  -->
 <!-- to the 'SUPPORTS' clause of the AGENT-CAPABILITIES macro.       -->
 <!-- The 'oid' element may be used to specify the OID value of the   -->
 <!-- MODULE-IDENTITY of the referenced module (as with the           -->
 <!-- 'ModuleIdentifier' part of the AGENT-CAPABILITIES' 'ModuleName' -->
 <!-- production) where the name of the module might otherwise be     -->
 <!-- ambiguous.                                                      -->
 <!-- =============================================================== -->

 <xsd:complexType name='CapabilityModule'>
  <xsd:sequence>
   <xsd:element name='comments' type='smi:MixedText' minOccurs='0'/>
   <xsd:element name='oid' type='smi:OIDValue' minOccurs='0'/>
   <xsd:element name='includes' minOccurs='0'>
    <xsd:complexType>
     <xsd:sequence>
      <xsd:element name='group' type='smi:ValueReference' minOccurs='0' maxOccurs='unbounded'/>
     </xsd:sequence>
    </xsd:complexType>
   </xsd:element>
   <xsd:element name='variations' minOccurs='0'>
    <xsd:complexType>
     <xsd:sequence>
      <xsd:element name='variation' type='smi:CapabilityVariation' minOccurs='0' maxOccurs='unbounded'/>
     </xsd:sequence>
    </xsd:complexType>
   </xsd:element>
  </xsd:sequence>
  <xsd:attribute name='name' type='smi:UCIdentifier' use='required'/>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'CapabilityVariation' type is used to specify a variation   -->
 <!-- from the MIB specification for an object or notification in an  -->
 <!-- AGENT-CAPABILITIES statement, corresponding to that macro's     -->
 <!-- VARIATION clause.  Either the 'name' attribute OR the 'oid'     -->
 <!-- element MUST be present to identify the object or notification. -->
 <!-- Under most circumstances, the 'name' attribute will be used, as -->
 <!-- many compiler implementations do not support referencing        -->
 <!-- objects or notifications by OID value within the VARIATION      -->
 <!-- clause, though technically allowed by a strict reading of the   -->
 <!-- macro's productions.                                            -->
 <!-- =============================================================== -->

 <xsd:complexType name='CapabilityVariation'>
  <xsd:sequence>
   <xsd:element name='comments' type='smi:MixedText' minOccurs='0'/>
   <xsd:element name='oid' type='smi:OIDValue' minOccurs='0'/>
   <xsd:element name='syntax' type='smi:Syntax' minOccurs='0'/>
   <xsd:element name='writesyntax' type='smi:Syntax' minOccurs='0'/>
   <xsd:element name='access' minOccurs='0'>
    <xsd:simpleType>
     <xsd:restriction base='xsd:string'>
      <xsd:enumeration value='not-implemented'/>
      <xsd:enumeration value='accessible-for-notify'/>
      <xsd:enumeration value='read-only'/>
      <xsd:enumeration value='read-write'/>
      <xsd:enumeration value='read-create'/>
      <xsd:enumeration value='write-only'/>
     </xsd:restriction>
    </xsd:simpleType>
   </xsd:element>
   <xsd:element name='creation' minOccurs='0'>
    <xsd:complexType>
     <xsd:sequence>
      <xsd:element name='column' type='smi:ValueReference' minOccurs='0' maxOccurs='unbounded'/>
     </xsd:sequence>
    </xsd:complexType>
   </xsd:element>
   <xsd:element name='defval' type='smi:DefaultValue' minOccurs='0'/>
   <xsd:element name='description' type='smi:MixedText' minOccurs='0'/>
  </xsd:sequence>
  <xsd:attribute name='name' type='smi:UCIdentifier' use='optional'/>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'Syntax' type is used to specify the data type used for an  -->
 <!-- ASN.1 Type Assignment, TEXTUAL-CONVENTION or OBJECT-TYPE.  This -->
 <!-- structure is somewhat general-purpose and analagous to ASN.1's  -->
 <!-- 'Type' production, allowing for specification of data type,     -->
 <!-- ASN.1 Tag for encoding (SMI Base Modules/Generic ASN.1 Modules  -->
 <!-- ONLY), and refinements to size, range and named number or named -->
 <!-- bit enumerations, as well as components for structured types    -->
 <!-- such as SEQUENCE.                                               -->
 <!--                                                                 -->
 <!-- For structured types, such as 'SEQUENCE' (used in MIB modules   -->
 <!-- to specify the a table's columns and their data types), the     -->
 <!-- 'name' property is used to name the column or component.        -->
 <!--                                                                 -->
 <!-- For example (SysOREntry):                                       -->
 <!--                                                                 -->
 <!-- [typedef name="SysOREntry"]                                     -->
 <!--  [syntax typeref="SEQUENCE"]                                    -->
 <!--   [components]                                                  -->
 <!--    [syntax name="sysORIndex" typeref="INTEGER"]                 -->
 <!--    [syntax name="sysORID" typeref="OBJECT IDENTIFIER"]          -->
 <!--    [syntax name="sysORDescr" typeref="DisplayString"]           -->
 <!--    [syntax name="sysORUpTime" typeref="TimeStamp"]              -->
 <!--   [/components]                                                 -->
 <!--  [/syntax]                                                      -->
 <!-- [/typedef]                                                      -->
 <!--                                                                 -->
 <!-- Deeper structures than the above are forbidden by the SMI.      -->
 <!-- They are allowed by this schema only for compatibility with     -->
 <!-- generic ASN.1 modules such as those defining SNMP its self.     -->
 <!-- =============================================================== -->

 <xsd:complexType name='Syntax'>
  <xsd:sequence>
   <xsd:element name='comments' type='smi:MixedText' minOccurs='0'/>

 <!-- =============================================================== -->
 <!-- SMI Base Modules/Generic ASN.1 Modules ONLY                     -->
 <!-- =============================================================== -->
   <xsd:element name='tag' type='smi:ASN1Tag' minOccurs='0'/>
 <!-- =============================================================== -->

   <xsd:choice minOccurs='0'>
    <xsd:element name='ranges' type='smi:RangeList'/>
    <xsd:element name='sizes' type='smi:SizeList'/>
    <xsd:element name='enumerations' type='smi:EnumerationList'/>
    <xsd:element name='components'>
     <xsd:complexType>
       <xsd:sequence>
        <xsd:element name='syntax' type='smi:Syntax' minOccurs='0' maxOccurs='unbounded'/>
       </xsd:sequence>
     </xsd:complexType>
    </xsd:element>
   </xsd:choice>
  </xsd:sequence>
  <xsd:attribute name='module' type='smi:UCIdentifier' use='optional'/>
  <xsd:attribute name='typeref' type='smi:TypeName' use='required'/>
  <xsd:attribute name='subtype' type='smi:TypeName' use='optional'/>
  <xsd:attribute name='name' type='smi:LCIdentifier' use='optional'/>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'ASN1Tag' type is used to specify an alternate tag for      -->
 <!-- the encoding of a derived type.  This property is provided ONLY -->
 <!-- for compatibility with SMI Base Modules and more general ASN.1  -->
 <!-- modules and MUST NOT be used for MIB modules.                   -->
 <!-- =============================================================== -->

 <xsd:complexType name='ASN1Tag'>
  <xsd:attribute name='class' type='smi:ASN1TagClass' default='context'/>
  <xsd:attribute name='module' type='smi:UCIdentifier' use='optional'/>
  <xsd:attribute name='value' type='smi:ASN1TagValue' use='required'/>
  <xsd:attribute name='implicit' type='xsd:boolean' default='false'/>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'ASN1TagClass' type corresponds to the TagClass element of  -->
 <!-- an ASN.1 Type Assignment, per ASN.1 syntax.  This property is   -->
 <!-- provided ONLY for compatibility with SMI Base Modules and more  -->
 <!-- general ASN.1 modules and MUST NOT be used for MIB modules.     -->
 <!-- =============================================================== -->

 <xsd:simpleType name='ASN1TagClass'>
  <xsd:restriction base='xsd:string'>
   <xsd:enumeration value='universal'/>
   <xsd:enumeration value='application'/>
   <xsd:enumeration value='private'/>
   <xsd:enumeration value='context'/>
  </xsd:restriction>
 </xsd:simpleType>

 <!-- =============================================================== -->
 <!-- The 'ASN1TagValue' type corresponds to the TagValue element of  -->
 <!-- an ASN.1 Type Assignment, per ASN.1 syntax.  This property is   -->
 <!-- provided ONLY for compatibility with SMI Base Modules and more  -->
 <!-- general ASN.1 modules and MUST NOT be used for MIB modules.     -->
 <!-- =============================================================== -->

 <xsd:simpleType name='ASN1TagValue'>
  <xsd:restriction base='xsd:string'>
   <xsd:pattern value='([0-9]+)|([a-z](-?[a-zA-Z0-9])*)'/>
  </xsd:restriction>
 </xsd:simpleType>

 <!-- =============================================================== -->
 <!-- The 'RangeList' type is used to specify a list of discrete      -->
 <!-- sub-ranges allowed by a data type or object of management       -->
 <!-- information corresponding to an integral value.  Zero or more   -->
 <!-- 'RangeSubspec' items may be present indicating a minimum and    -->
 <!-- maximum for an allowed range of values for the type or object.  -->
 <!-- =============================================================== -->

 <xsd:complexType name='RangeList'>
  <xsd:sequence>
    <xsd:element name='range' type='smi:RangeSubspec' minOccurs='0' maxOccurs='unbounded'/>
  </xsd:sequence>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'SizeList' type is used to specify a list of discrete       -->
 <!-- sub-lengths allowed by a data type or object of management      -->
 <!-- information corresponding to an octet string value.  Zero or    -->
 <!-- more 'RangeSubspec' items may be present indicating a minimum   -->
 <!-- and maximum for an allowed range of lengths for the type or     -->
 <!-- object.                                                         -->
 <!-- =============================================================== -->

 <xsd:complexType name='SizeList'>
  <xsd:sequence>
    <xsd:element name='size' type='smi:RangeSubspec' minOccurs='0' maxOccurs='unbounded'/>
  </xsd:sequence>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'RangeSubspec' type is used to specify a single pair of     -->
 <!-- minimum and maximum values or lengths for a partial range or    -->
 <!-- size specification.  Both the 'min' and 'max' values must be    -->
 <!-- present, even if those values are equal, in order to avoid      -->
 <!-- potential confusion in having only a minimum (or maximum) or    -->
 <!-- the complexity of having a third single-valued attribute.       -->
 <!-- =============================================================== -->

 <xsd:complexType name='RangeSubspec'>
  <xsd:attribute name='min' type='xsd:integer' use='required'/>
  <xsd:attribute name='max' type='xsd:integer' use='required'/>
  <xsd:attribute name='minformat' default='integer'/>
   <xsd:restriction base='xsd:string'>
    <xsd:enumeration value='integer'/>
    <xsd:enumeration value='hstring'/>
    <xsd:enumeration value='bstring'/>
   </xsd:restriction>
  <xsd:attribute name='maxformat' default='integer'>
   <xsd:restriction base='xsd:string'>
    <xsd:enumeration value='integer'/>
    <xsd:enumeration value='hstring'/>
    <xsd:enumeration value='bstring'/>
   </xsd:restriction>
  </xsd:attribute>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'EnumerationList' type is used to specify a list of named   -->
 <!-- number enumerations or named bit values allowed by a data type  -->
 <!-- or object of management information.  Whether these items are   -->
 <!-- taken to be named numbers or named bits depends on the base     -->
 <!-- type involved (i.e., named bits if the base type is 'BITS').    -->
 <!-- Zero or more 'Enumeration' items may be present, one for each   -->
 <!-- named number or bit allowed.  They SHOULD be listed in order    -->
 <!-- of increasing value for ease in processing, though this is not  -->
 <!-- necessarily a requirement and implementations would be well     -->
 <!-- advised to sort such values where needed.                       -->
 <!-- =============================================================== -->

 <xsd:complexType name='EnumerationList'>
  <xsd:sequence>
    <xsd:element name='enumeration' type='smi:Enumeration' minOccurs='0' maxOccurs='unbounded'/>
  </xsd:sequence>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'Enumeration' type is used to specify a single named number -->
 <!-- or named bit allowed by a data type or MIB object.              -->
 <!-- =============================================================== -->

 <xsd:complexType name='Enumeration'>
  <xsd:sequence>
    <xsd:element name='comments' type='smi:MixedText' minOccurs='0'/>
  </xsd:sequence>
  <xsd:attribute name='name' type='smi:LCIdentifier' use='required'/>
  <xsd:attribute name='value' type='xsd:integer' use='required'/>
  <xsd:attribute name='format' default='integer'>
   <xsd:restriction base='xsd:string'>
    <xsd:enumeration value='integer'/>
    <xsd:enumeration value='hstring'/>
    <xsd:enumeration value='bstring'/>
   </xsd:restriction>
  </xsd:attribute>
 </xsd:complexType>

 <!-- =============================================================== -->
 <!-- The 'Categories' type follows the same form as EnumerationList, -->
 <!-- but with a different element name, used for SUBJECT-CATEGORIES. -->
 <!-- =============================================================== -->

 <xsd:complexType name='Categories'>
  <xsd:sequence>
    <xsd:element name='category' type='smi:Enumeration' minOccurs='0' maxOccurs='unbounded'/>
  </xsd:sequence>
 </xsd:complexType>

 <xsd:annotation>
  <xsd:documentation>

   REVISION HISTORY

   -- Published as version 2.1 --

   05/30/2007 - Corrected 'piberrors' type to be EnumerationList
   instead of ValueReference to match INSTALL-ERRORS definition and
   MIB Smithy implementation.

   06/07/2004 - Added optional format specifiers for size/range/enumeration
   values to allow the desired (or source) format of the integer to be
   indicated.

   06/04/2004 - Made ObjectType's access element optional for PIB module
   compatibility (where only the table has PIB-ACCESS specified).

   05/13/2004 - Removed items reserved for SMIng, which was abandoned
   and isn't showing signs of being restarted.  Added support for
   COPS-PR-SPPI modules.

   -- Published as version 2.0 --

   07/03/2003 - Bug/typo fixes.  SubIdentifier's "value" should be
   nonNegativeInteger rather than positiveInteger to allow 0.  Syntax's
   "tag" element should be optional.

   07/01/2003 - Bug/typo fixes.  OIDvalue should be OIDValue.  xsd:any
   should be xsd:anyType.  positiveinteger should be positiveInteger.
   smi:string in DefaultValue should be xsd:string.  AgentCapabilities'
   release attribute must be a simple type.  Removed xsd:element and
   xsd:complexType wrappers around the choice for the various index
   types in ObjectType, which probably aren't needed.

   06/28/2003 - Bug/typo fixes.  'IDETNIFIER' in TypeName, 'xsd:LCIdentifier'
   in DefaultValue.  Deleted SMIv1 status values from ObjectIdent (since
   OBJECT-IDENTITY doesn't exist in SMIv1, this item can never legally
   take those values).  Deleted reference to ValueReference in IndexList
   docs, which isn't used there anymore.  Description fields are now
   consistently optional as intended/implemented.

   04/26/2003 - Bumped version to 2.0 for more-or-less official release.

   04/26/2003 - Added optional 'value' attribute to OIDValue that allows
   supporting implementations to provide (in addition to the normal
   'subid' element form) an absolute OID in order to aid lookups by OID,
   per request by J. Schoenwaelder and others.

   04/26/2003 - Element naming changes for consistency and suggestions from
   J. Schoenwaelder: exportslist, importslist, typedefslist, macroslist,
   moduleidentity, objectidentity, rangelist, sizelist and indexlist are
   now exports, imports, typedefs, macros, moduleid, objectid, ranges,
   sizes and indices.

   04/26/2003 - Added 'pre', 'para' and 'br' element specs to the MixedText
   type.  NOTE: since these are now defined, the default behavior for
   MixedText is to be wrapped and NOT to be pre-formatted.  If you want
   pre-formatted text, wrap the text in "pre" tags.

   04/21/2003 - Deleted obsolete 'type' attribute from objectgroup and
   notifygroup that was leftover from when these were joined.
   Added 'module' attribute to 'ASN1Tag' type to split moduleref.valueref
   format into separate attributes.

   04/08/2003 - Added missing 'comments' field to ModuleIdentity structure.
   Changed 'column' element for CREATION-REQUIRES to ValueReference
   instead of LCIdentifier.  Added 'idlist' DefaultValue for named bits.
   Added 'implicit' attribute to ASN1Tag and corrected 'value' attribute
   to point to 'smi:ASN1TagValue' instead of 'xsd:ASN1TagValue'.

   04/07/2003 - Corrected 'identifier' DefaultValue choice to allow only
   lowercase identifiers.  Corrected hex string pattern.  Changed
   LCIdentifier/UCIdentifier to be derived from Identifier.

   04/06/2003 - Deleted defval element from typedef.

   04/05/2003 - Changed imports/exports to importslist/exportslist,
   and subelements thereof to use attributes.  Moved identity
   element of ModuleDefinition into assignmentslist area (as
   'moduleidentity').  This should make looking up the OID for the
   identity easier by having it in the same place as other OID
   assignments.  Changed some type names to use uppercase characters
   consitently (e.g. 'LCIdentifier' instead of 'lcidentifier').
   Changed 'basetype' to 'typeref'.

   12/27/2002 - Added subtype attribute to Syntax complexType, used
   for single-identifier subtypes (e.g. "SEQUENCE OF SysOREntry").
   Changed 'basetype' attribute in Syntax to 'smi:typename' which
   has a pattern that will except two-part types such as "SEQUENCE
   OF" or "OCTET STRING".  Removed reference element from ModuleIdentity
   type.  Added comments element to Group type.  Corrected GroupMembers
   type to not require a superfluous object element.  Corrected
   GroupsList to allow more than one group.  Changed 'modules' to
   'module' in ModuleCompliance and AgentCapabilities.  (Alternatively,
   could put all modules under a container element?)

   12/22/2002 - Modified to use qualified schema elements (e.g.
   xsd:complexType vs. complexType), fixed some unqualified smi
   type references.  Added support for ASN.1 tags on types for SMI
   Base Modules/protocol specs.  Added DISPLAY-HINT pattern.  Added
   doctype and XML version headers.

   12/20/2002 - Converted to Schema via dtd2xsd.pl and modified/extended
   with a number of fixes and enhancements by Michael Kirkham.
   Converted all top-level elements to types, added patterns, added
   AGENT-CAP support, added misc. SMI Base Module Only features,
   redefined rules for multiple-module support, altered form for
   imports, etc.

  </xsd:documentation>
 </xsd:annotation>
</xsd:schema>
