<?xml version="1.0" encoding="UTF-8"?>
<!--
  TR-069 Device Type Schema (DT Schema) v1.6

  Copyright (c) 2009-2022, Broadband Forum

  Redistribution and use in source and binary forms, with or
  without modification, are permitted provided that the following
  conditions are met:

  1. Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above
     copyright notice, this list of conditions and the following
     disclaimer in the documentation and/or other materials
     provided with the distribution.

  3. Neither the name of the copyright holder nor the names of its
     contributors may be used to endorse or promote products
     derived from this software without specific prior written
     permission.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
  CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

  The above license is used as a license under copyright only.
  Please reference the Forum IPR Policy for patent licensing terms
  <https://www.broadband-forum.org/ipr-policy>.

  Any moral rights which are necessary to exercise under the above
  license grant are also deemed granted under this license.

  Summary:
    TR-069 Device Type Schema (DT Schema).  DT Instances describe individual
    devices' support for TR-069 data models.

  Comments or questions about this Broadband Forum data model should be
  directed to <info@broadband-forum.org>.
-->

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:tns="urn:broadband-forum-org:cwmp:devicetype-1-6"
  xmlns:dm="urn:broadband-forum-org:cwmp:datamodel-1-9"
  xmlns:dtf="urn:broadband-forum-org:cwmp:devicetype-features"
  targetNamespace="urn:broadband-forum-org:cwmp:devicetype-1-6" elementFormDefault="unqualified"
  attributeFormDefault="unqualified">
  <xs:import namespace="urn:broadband-forum-org:cwmp:datamodel-1-9"
    schemaLocation="https://www.broadband-forum.org/cwmp/cwmp-datamodel-1-9.xsd"/>
  <xs:import namespace="urn:broadband-forum-org:cwmp:devicetype-features"
    schemaLocation="https://www.broadband-forum.org/cwmp/cwmp-devicetype-features.xsd"/>
  <!-- Simple types -->
  <xs:simpleType name="ActiveNotify">
    <xs:annotation>
      <xs:documentation>Parameter active notify support (based on dm:activeNotify).</xs:documentation>
    </xs:annotation>
    <xs:restriction base="dm:String">
      <xs:enumeration value="normal"/>
      <xs:enumeration value="willDeny"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="ListNesting">
    <xs:annotation>
      <xs:documentation>Nested list escaping support (based on dm:ListNesting).</xs:documentation>
    </xs:annotation>
    <xs:restriction base="dm:String">
      <xs:enumeration value="unknown">
        <xs:annotation>
          <xs:documentation>No information (for DM="permitted", Controller can't infer support).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="unsupported">
        <xs:annotation>
          <xs:documentation>Not supported (not valid for DM="required"; for DM="permitted", Controller can't infer support).</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="supported">
        <xs:annotation>
          <xs:documentation>Supported (not valid for DM="legacy").</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="ObjectAccess">
    <xs:annotation>
      <xs:documentation>Object access (based on dm:ProfileObjectAccess).</xs:documentation>
    </xs:annotation>
    <xs:restriction base="dm:String">
      <xs:enumeration value="readOnly"/>
      <xs:enumeration value="create"/>
      <xs:enumeration value="delete"/>
      <xs:enumeration value="createDelete"/>
    </xs:restriction>
  </xs:simpleType>
  <!-- Model groups -->
  <xs:group name="AllBuiltinDataTypes">
    <xs:annotation>
      <xs:documentation>All built-in data types.</xs:documentation>
    </xs:annotation>
    <xs:choice>
      <xs:element name="base64">
        <xs:complexType>
          <xs:sequence>
            <xs:choice minOccurs="0" maxOccurs="unbounded">
              <xs:element name="size" type="tns:SizeFacet"/>
            </xs:choice>
            <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
          <xs:anyAttribute namespace="##other"/>
        </xs:complexType>
      </xs:element>
      <xs:element name="boolean">
        <xs:complexType>
          <xs:sequence>
            <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
          <xs:anyAttribute namespace="##other"/>
        </xs:complexType>
      </xs:element>
      <xs:element name="dateTime">
        <xs:complexType>
          <xs:sequence>
            <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
          <xs:anyAttribute namespace="##other"/>
        </xs:complexType>
      </xs:element>
      <xs:element name="hexBinary">
        <xs:complexType>
          <xs:sequence>
            <xs:choice minOccurs="0" maxOccurs="unbounded">
              <xs:element name="size" type="tns:SizeFacet"/>
            </xs:choice>
            <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
          <xs:anyAttribute namespace="##other"/>
        </xs:complexType>
      </xs:element>
      <xs:element name="int">
        <xs:complexType>
          <xs:sequence>
            <xs:choice minOccurs="0" maxOccurs="unbounded">
              <xs:element name="range" type="tns:RangeFacet"/>
            </xs:choice>
            <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
          <xs:anyAttribute namespace="##other"/>
        </xs:complexType>
      </xs:element>
      <xs:element name="long">
        <xs:complexType>
          <xs:sequence>
            <xs:choice minOccurs="0" maxOccurs="unbounded">
              <xs:element name="range" type="tns:RangeFacet"/>
            </xs:choice>
            <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
          <xs:anyAttribute namespace="##other"/>
        </xs:complexType>
      </xs:element>
      <xs:element name="string">
        <xs:complexType>
          <xs:sequence>
            <xs:choice minOccurs="0" maxOccurs="unbounded">
              <xs:element name="size" type="tns:SizeFacet"/>
              <xs:element name="pathRef" type="tns:PathRefFacet"/>
              <xs:element name="enumeration" type="tns:EnumerationFacet"/>
              <xs:element name="pattern" type="tns:PatternFacet"/>
            </xs:choice>
            <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
          <xs:anyAttribute namespace="##other"/>
        </xs:complexType>
        <xs:unique name="stringEnumerationValue">
          <xs:selector xpath="enumeration"/>
          <xs:field xpath="@value"/>
        </xs:unique>
        <xs:unique name="stringPatternValue">
          <xs:selector xpath="pattern"/>
          <xs:field xpath="@value"/>
        </xs:unique>
      </xs:element>
      <xs:element name="unsignedInt">
        <xs:complexType>
          <xs:sequence>
            <xs:choice minOccurs="0" maxOccurs="unbounded">
              <xs:element name="range" type="tns:RangeFacet"/>
            </xs:choice>
            <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
          <xs:anyAttribute namespace="##other"/>
        </xs:complexType>
      </xs:element>
      <xs:element name="unsignedLong">
        <xs:complexType>
          <xs:sequence>
            <xs:choice minOccurs="0" maxOccurs="unbounded">
              <xs:element name="range" type="tns:RangeFacet"/>
            </xs:choice>
            <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
          <xs:anyAttribute namespace="##other"/>
        </xs:complexType>
      </xs:element>
    </xs:choice>
  </xs:group>
  <xs:group name="AllFacets">
    <xs:annotation>
      <xs:documentation>All facets.</xs:documentation>
    </xs:annotation>
    <xs:choice>
      <xs:element name="size" type="tns:SizeFacet"/>
      <xs:element name="pathRef" type="tns:PathRefFacet"/>
      <xs:element name="range" type="tns:RangeFacet"/>
      <xs:element name="enumeration" type="tns:EnumerationFacet"/>
      <xs:element name="pattern" type="tns:PatternFacet"/>
    </xs:choice>
  </xs:group>
  <!-- Complex types -->
  <xs:complexType name="Annotation">
    <xs:annotation>
      <xs:documentation>Annotation.</xs:documentation>
    </xs:annotation>
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:anyAttribute namespace="##other"/>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
  <xs:complexType name="BaseAccessFacet" abstract="true">
    <xs:annotation>
      <xs:documentation>Base facet (access attribute).</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="tns:BaseStatusFacet">
        <xs:attribute name="access" type="dm:ReadWriteAccess" default="readWrite"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="BaseStatusFacet" abstract="true">
    <xs:annotation>
      <xs:documentation>Base facet (no attributes).</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="annotation" type="tns:Annotation" minOccurs="0"/>
      <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>
  <xs:complexType name="Bibliography">
    <xs:annotation>
      <xs:documentation>Bibliography definition.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:choice>
        <xs:element name="annotation" type="tns:Annotation" minOccurs="0"/>
        <xs:element name="description" type="dm:Description" minOccurs="0">
          <xs:annotation>
            <xs:documentation>The description element is DEPRECATED because it was added in error.  The annotation element SHOULD be used instead.</xs:documentation>
          </xs:annotation>
        </xs:element>
      </xs:choice>
      <xs:element name="reference" minOccurs="0" maxOccurs="unbounded" type="dm:BibliographyReference"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="DefaultFacet">
    <xs:annotation>
      <xs:documentation>Default facet.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="tns:BaseStatusFacet">
        <xs:attribute name="type" type="dm:ArgumentDefaultType" use="required"/>
        <xs:attribute name="value" type="xs:string" use="required">
          <xs:annotation>
            <xs:documentation>Value MUST be valid for the data type.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="EnumerationFacet">
    <xs:annotation>
      <xs:documentation>Enumeration facet.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="tns:BaseAccessFacet">
        <xs:attribute name="value" type="dm:String" use="required"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Import">
    <xs:annotation>
      <xs:documentation>Import data types and models (Root and Service Objects) from DM Instances.  All such items MUST be imported (this is checked by schema validation).</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="dataType">
          <xs:complexType>
            <xs:attribute name="name" type="dm:DataTypeName" use="required"/>
          </xs:complexType>
        </xs:element>
        <xs:element name="model">
          <xs:annotation>
            <xs:documentation>The DT Instance SHOULD NOT import more than one DM model.  This is because a DT Instance can't reference more than one DM model, so there is no reason to import more than DM model.</xs:documentation>
          </xs:annotation>
          <xs:complexType>
            <xs:attribute name="name" type="dm:ModelName" use="required"/>
          </xs:complexType>
        </xs:element>
      </xs:choice>
      <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="file" type="xs:anyURI" use="required">
      <xs:annotation>
        <xs:documentation>MUST be used to locate the DM Instance (B.2.1).</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="spec" type="xs:anyURI">
      <xs:annotation>
        <xs:documentation>If specified, processing tools MUST regard a mismatch between this and the external document's spec attribute as an error.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>
  <xs:complexType name="ListFacet">
    <xs:annotation>
      <xs:documentation>List facet.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="tns:BaseStatusFacet">
        <xs:sequence>
          <xs:choice minOccurs="0" maxOccurs="unbounded">
            <xs:element name="size" type="tns:SizeFacet">
              <xs:annotation>
                <xs:documentation>This specifies the size of the TR-069 list-valued parameter, not of the individual list items.</xs:documentation>
              </xs:annotation>
            </xs:element>
          </xs:choice>
        </xs:sequence>
        <xs:attribute name="minItems" type="xs:nonNegativeInteger" default="0"/>
        <xs:attribute name="maxItems" type="dm:MaxEntries" default="unbounded"/>
        <xs:attribute name="nestedBrackets" type="tns:ListNesting" default="unknown"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Model">
    <xs:annotation>
      <xs:documentation>Model (Root and Service Object) support details.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="annotation" type="tns:Annotation" minOccurs="0"/>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="parameter" type="tns:ModelParameter"/>
        <xs:element name="object" type="tns:ModelObject">
          <xs:unique name="objectParameterName">
            <xs:selector xpath="parameter"/>
            <xs:field xpath="@ref"/>
          </xs:unique>
        </xs:element>
      </xs:choice>
      <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="ref" type="dm:ModelName" use="required"/>
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>
  <xs:complexType name="ModelObject">
    <xs:annotation>
      <xs:documentation>Object support details</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="annotation" type="tns:Annotation" minOccurs="0"/>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="parameter" type="tns:ModelParameter"/>
        <xs:element name="event" type="tns:ModelEvent"/>
        <xs:element name="command" type="tns:ModelCommand"/>
      </xs:choice>
      <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="ref" type="dm:ObjectName" use="required"/>
    <xs:attribute name="access" type="tns:ObjectAccess" use="required"/>
    <xs:attribute name="minEntries" type="xs:nonNegativeInteger" use="required">
      <xs:annotation>
        <xs:documentation>minEntries MUST be greater than or equal to minEntries(DM), and less than or equal to maxEntries (all values are regarded as being less than "unbounded").</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="maxEntries" type="dm:MaxEntries" use="required">
      <xs:annotation>
        <xs:documentation>maxEntries MUST be less than or equal to maxEntries(DM) (all values are regarded as being less than "unbounded").</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>
  <xs:complexType name="ModelParameter">
    <xs:annotation>
      <xs:documentation>Parameter support details.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="annotation" type="tns:Annotation" minOccurs="0"/>
      <xs:element name="syntax" type="tns:Syntax" minOccurs="0"/>
      <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="ref" type="dm:ParameterName" use="required"/>
    <xs:attribute name="access" type="dm:ReadWriteAccess" use="required"/>
    <xs:attribute name="activeNotify" type="tns:ActiveNotify" default="normal"/>
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>
  <xs:complexType name="ModelEvent">
    <xs:annotation>
      <xs:documentation>Event support details.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="annotation" type="tns:Annotation" minOccurs="0"/>
      <xs:element name="syntax" type="tns:Syntax" minOccurs="0"/>
      <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="object" type="tns:ModelEventObject"/>
        <xs:element name="parameter" type="tns:ModelEventParameter"/>
      </xs:choice>
    </xs:sequence>
    <xs:attribute name="ref" type="dm:EventName" use="required"/>
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>
  <xs:complexType name="ModelEventObject">
    <xs:annotation>
      <xs:documentation>Event object details.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="annotation" type="tns:Annotation" minOccurs="0"/>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="parameter" type="tns:ModelEventParameter"/>
      </xs:choice>
      <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="ref" type="dm:ObjectName" use="required"/>
    <xs:attribute name="minEntries" type="xs:nonNegativeInteger" use="required">
      <xs:annotation>
        <xs:documentation>minEntries MUST be greater than or equal to minEntries(DM), and less than or equal to maxEntries (all values are regarded as being less than "unbounded").</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="maxEntries" type="dm:MaxEntries" use="required">
      <xs:annotation>
        <xs:documentation>maxEntries MUST be less than or equal to maxEntries(DM) (all values are regarded as being less than "unbounded").</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>
  <xs:complexType name="ModelEventParameter">
    <xs:annotation>
      <xs:documentation>Event parameter details.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="annotation" type="tns:Annotation" minOccurs="0"/>
      <xs:element name="syntax" type="tns:Syntax" minOccurs="0"/>
      <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="ref" type="dm:ParameterName" use="required"/>
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>
  <xs:complexType name="ModelCommand">
    <xs:annotation>
      <xs:documentation>Command support details.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="annotation" type="tns:Annotation" minOccurs="0"/>
      <xs:element name="syntax" type="tns:Syntax" minOccurs="0"/>
      <xs:element name="input" type="tns:ModelCommandArgs" minOccurs="0"/>
      <xs:element name="output" type="tns:ModelCommandArgs" minOccurs="0"/>
      <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="ref" type="dm:CommandName" use="required"/>
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>
  <xs:complexType name="ModelCommandArgs">
    <xs:annotation>
      <xs:documentation>Command argument details.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="annotation" type="tns:Annotation" minOccurs="0"/>
      <xs:element name="syntax" type="tns:Syntax" minOccurs="0"/>
      <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="object" type="tns:ModelCommandArgObject"/>
        <xs:element name="parameter" type="tns:ModelCommandArgParameter"/>
      </xs:choice>
    </xs:sequence>
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>
  <xs:complexType name="ModelCommandArgObject">
    <xs:annotation>
      <xs:documentation>Command argument object details.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="annotation" type="tns:Annotation" minOccurs="0"/>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="parameter" type="tns:ModelCommandArgParameter"/>
      </xs:choice>
      <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="ref" type="dm:ObjectName" use="required"/>
    <xs:attribute name="minEntries" type="xs:nonNegativeInteger" use="required">
      <xs:annotation>
        <xs:documentation>minEntries MUST be greater than or equal to minEntries(DM), and less than or equal to maxEntries (all values are regarded as being less than "unbounded").</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="maxEntries" type="dm:MaxEntries" use="required">
      <xs:annotation>
        <xs:documentation>maxEntries MUST be less than or equal to maxEntries(DM) (all values are regarded as being less than "unbounded").</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>
  <xs:complexType name="ModelCommandArgParameter">
    <xs:annotation>
      <xs:documentation>Command argument parameter details.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="annotation" type="tns:Annotation" minOccurs="0"/>
      <xs:element name="syntax" type="tns:Syntax" minOccurs="0"/>
      <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="ref" type="dm:ParameterName" use="required"/>
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>
  <xs:complexType name="PathRefFacet">
    <xs:annotation>
      <xs:documentation>Path name reference facet.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="tns:BaseStatusFacet">
        <xs:attribute name="targetParent" type="dm:ObjectReferencePatterns" default=""/>
        <xs:attribute name="targetType" type="dm:TargetType" default="any"/>
        <xs:attribute name="targetDataType" type="dm:AnyTypeName" default="any"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="PatternFacet">
    <xs:annotation>
      <xs:documentation>Pattern facet (pattern syntax is as in XML Schema).</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="tns:BaseAccessFacet">
        <xs:attribute name="value" type="xs:string" use="required"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="RangeFacet">
    <xs:annotation>
      <xs:documentation>Range facet.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="tns:BaseAccessFacet">
        <xs:attribute name="minInclusive" type="xs:integer"/>
        <xs:attribute name="maxInclusive" type="xs:integer"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="SizeFacet">
    <xs:annotation>
      <xs:documentation>Size facet.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="tns:BaseAccessFacet">
        <xs:attribute name="minLength" type="xs:nonNegativeInteger" default="0"/>
        <xs:attribute name="maxLength" type="xs:nonNegativeInteger"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="DataTypeReference">
    <xs:annotation>
      <xs:documentation>Parameter data type reference or anonymous restriction / extension.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:group ref="tns:AllFacets" minOccurs="0" maxOccurs="unbounded"/>
      <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="ref" type="dm:DataTypeName">
      <xs:annotation>
        <xs:documentation>If specified, content MUST be empty.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="base" type="dm:DataTypeName">
      <xs:annotation>
        <xs:documentation>If specified, content MUST NOT be empty.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>
  <xs:complexType name="Syntax">
    <xs:annotation>
      <xs:documentation>Parameter syntax support details.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="list" type="tns:ListFacet" minOccurs="0"/>
      <xs:choice>
        <xs:group ref="tns:AllBuiltinDataTypes">
          <xs:annotation>
            <xs:documentation>Direct use of built-in data type (which MUST be the same data type as that in the referenced DM Instance), possibly modified via use of facets.</xs:documentation>
          </xs:annotation>
        </xs:group>
        <xs:element name="dataType" type="tns:DataTypeReference">
          <xs:annotation>
            <xs:documentation>Use of named data type (which MUST be the same data type as that in the referenced DM Instance), possibly modified via use of facets.</xs:documentation>
          </xs:annotation>
          <xs:unique name="dtRefEnumerationValue">
            <xs:selector xpath="enumeration"/>
            <xs:field xpath="@value"/>
          </xs:unique>
          <xs:unique name="dtRefPatternValue">
            <xs:selector xpath="pattern"/>
            <xs:field xpath="@value"/>
          </xs:unique>
        </xs:element>
      </xs:choice>
      <xs:element name="default" type="tns:DefaultFacet" minOccurs="0">
        <xs:annotation>
          <xs:documentation>A default MUST NOT be specified if the DM Instance has already specified a factory or object default.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
    <xs:anyAttribute namespace="##other"/>
  </xs:complexType>
  <xs:complexType name="ToplevelFeature">
    <xs:annotation>
      <xs:documentation>Top-level feature.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="annotation" type="tns:Annotation" minOccurs="0"/>
    </xs:sequence>
    <xs:attribute name="name" type="dtf:FeatureName" use="required"/>
  </xs:complexType>
  <!-- Elements -->
  <xs:element name="document">
    <xs:annotation>
      <xs:documentation>CWMP Device Type XML Schema (DT Schema) instance documents can contain the following:
* Imports (from DM Schema instance documents) of Root or Service Object definitions
* Declarations of which features of imported Root or Service Objects are supported</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element name="annotation" type="tns:Annotation" minOccurs="0">
          <xs:annotation>
            <xs:documentation>Top-level annotation.</xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="import" type="tns:Import" minOccurs="0" maxOccurs="unbounded">
          <xs:annotation>
            <xs:documentation>Imported models (Root and Service Objects).</xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="bibliography" type="tns:Bibliography" minOccurs="0">
          <xs:annotation>
            <xs:documentation>Bibliographic references.</xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="feature" type="tns:ToplevelFeature" minOccurs="0" maxOccurs="unbounded">
          <xs:annotation>
            <xs:documentation>Top-level features.</xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="model" type="tns:Model" minOccurs="0">
          <xs:annotation>
            <xs:documentation>Details of support for model (Root and Service Object).</xs:documentation>
          </xs:annotation>
          <xs:unique name="modelParameterName">
            <xs:selector xpath="parameter"/>
            <xs:field xpath="@ref"/>
          </xs:unique>
          <xs:unique name="modelObjectName">
            <xs:selector xpath="object"/>
            <xs:field xpath="@ref"/>
          </xs:unique>
        </xs:element>
      </xs:sequence>
      <xs:attribute name="deviceType" use="required">
        <xs:annotation>
          <xs:documentation>URI indicating the device type associated with this DT Instance.</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:anyURI">
            <xs:pattern value=".+"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="uuid" use="required" type="dm:UUID">
        <xs:annotation>
          <xs:documentation>UUID that MUST uniquely identify this DT instance, e.g. RFC 4122 version 5 UUID derived from the instance text.</xs:documentation>
        </xs:annotation>
      </xs:attribute>
    </xs:complexType>
    <xs:unique name="dataTypeName">
      <xs:selector xpath="import/dataType"/>
      <xs:field xpath="@name"/>
    </xs:unique>
    <xs:keyref name="dataTypeBase" refer="tns:dataTypeName">
      <xs:selector xpath=".//parameter/syntax/dataType"/>
      <xs:field xpath="@base"/>
    </xs:keyref>
    <xs:keyref name="dataTypeRef" refer="tns:dataTypeName">
      <xs:selector xpath=".//parameter/syntax/dataType"/>
      <xs:field xpath="@ref"/>
    </xs:keyref>
    <xs:unique name="modelName">
      <xs:selector xpath="import/model"/>
      <xs:field xpath="@name"/>
    </xs:unique>
    <xs:unique name="modelRef">
      <xs:selector xpath="model"/>
      <xs:field xpath="@ref"/>
    </xs:unique>
    <xs:keyref name="modelDef" refer="tns:modelName">
      <xs:selector xpath="model"/>
      <xs:field xpath="@ref"/>
    </xs:keyref>
  </xs:element>
</xs:schema>
