<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc SYSTEM "rfc2629-xhtml.ent">
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="4"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="std" ipr="trust200902"
    docName="draft-ietf-netmod-yang-schema-comparison-10" updates="7950"
    submissionType="IETF" consensus="true">
  <front>
    <title abbrev="YANG Schema Comparison">YANG Schema Comparison</title>
    <author initials="M." role="editor" surname="Vaško" fullname="Michal Vaško">
      <organization abbrev="CESNET">
        CESNET
      </organization>
      <address>
        <email>mvasko@cesnet.cz</email>
      </address>
    </author>
    <author initials="P." surname="Andersson" fullname="Per Andersson">
      <organization abbrev="Ionio Systems">
        Ionio Systems
      </organization>
      <address>
        <email>per.ietf@ionio.se</email>
      </address>
    </author>
    <author initials="R." surname="Wilton" fullname="Robert Wilton">
      <organization abbrev="Cisco Systems, Inc.">
        Cisco Systems, Inc.
      </organization>
      <address>
        <email>rwilton@cisco.com</email>
      </address>
    </author>
    <date/>
    <abstract>
        <t>
            This document specifies an algorithm with two input variants for
            comparing revisions of a YANG schema to determine the scope of
            changes and produce a list of the changes between the revisions.
            The output of the algorithm can be used to help select an
            appropriate YANG semantic version number for a new YANG Module
            revision. It also specifies a YANG module for YANG-structured
            output of these algorithms, that can be easily consumed in a
            machine-readable way.
        </t>
    </abstract>
  </front>
  <middle>
    <section anchor="intro" numbered="true" toc="default">
      <name>Introduction</name>
        <t>
            This document defines a common algorithm for comparing two
            revisions of a YANG schema. As input, there can be two types of
            YANG schema representations: single locally resolved YANG modules
            or fully resolved set of YANG modules (on-the-wire schema). The
            algorithm output for each of these representations serves a
            different purpose. It can help YANG authors with assigning the
            correct semantic version of a module based on
            <xref target="I-D.ietf-netmod-yang-semver" format="default"/> or
            tools processing YANG instance data can use it to learn about the
            exact data changes, respectively.
        </t>
        <t>
            The algorithm operates in a straightforward way traversing all the
            statements and their substatements in both the old and new module
            representations collecting identified changes. These are then
            reported in a concise output with information about the overall
            backwards compatibility between the two modules. Exact output
            format is out of scope for this document but Appendix A includes an
            example of a YANG module whose YANG data can represent all the
            possible changes and so a complete output of this algorithm.
        </t>
        <t>
            Every change is classified as editorial, backwards-compatible, or
            non-backwards-compatible. This conformance is decided based on
            rules found in other documents, specifically
            <xref target="RFC7950" format="default"/>,
            <xref target="I-D.ietf-netmod-yang-module-versioning" format="default"/>,
            and <xref target="I-D.ietf-netmod-yang-semver" format="default"/>.
            For older YANG 1.0 modules, the rules in
            <xref target="RFC6020" format="default"/> apply instead.
        </t>
    </section>
    <section anchor="terminology" numbered="true" toc="default">
      <name>Terminology and Conventions</name>
      <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
   "OPTIONAL" in this document are to be interpreted as described in BCP 14
   <xref target="RFC2119" format="default"/> <xref target="RFC8174" format="default"/> when, and only when, they
   appear in all capitals, as shown here.</t>
      <t>
          This document makes use of the following terminology introduced in
          the YANG 1.1 Data Modeling Language <xref target="RFC7950"/>:
        <list style="symbols">
          <t>module</t>
          <t>schema node</t>
          <t>data node</t>
          <t>data definition statement</t>
        </list>
      </t>
      <t>
          In addition, this document uses the following terminology:
        <list style="symbols">
            <t>locally resolved module: A parsed YANG module with all its
                submodules and local references resolved.</t>
            <t>fully resolved schema: A locally resolved module with all the
                imported references resolved as well and with non data
                definition statements removed.</t>
        </list>
      </t>
    </section>
    <section anchor="schema_representations" numbered="true" toc="default">
        <name>Schema representations</name>
        <t>
            The YANG language defines several statements that act as syntactic
            abstraction and need to be processed before a YANG module can be
            used for handling YANG instance data. For example, a “uses”
            statement is replaced by all the substatements of a referenced
            “grouping” statement or a “typedef” statement can be linked to
            other “type” statements. The referenced statements can be local
            (defined in the same module, or included submodule) but also
            foreign (defined in another imported module).
        </t>
        <section anchor="locally_resolved_module" numbered="true" toc="default">
            <name>Locally resolved module (single module)</name>
            <t>
                This representation of a YANG module includes all submodules of the
                main module but resolves only statements that reference other
                statements found in the same module. No references to imported
                modules (that are using an imported prefix) are resolved.
            </t>
            <t>
                For example, any changes of a referenced “typedef” or “grouping”
                defined in an imported module would not affect the locally resolved
                module and are out of scope for this representation.
            </t>
            <t>
                All the rules for classifying individual statement changes
                mentioned in <xref target="change_conformance" format="default"/>
                apply to this module representation.
            </t>
            <section anchor="local_deviation" numbered="true" toc="default">
                <name>Deviation</name>
                <t>
                    Regardless of whether the “deviation” target node is local
                    in the same module or in an imported module, it is never
                    resolved and applied. Instead, the “deviation” statement
                    with all its substatements is kept in the locally resolved
                    module so that it can be considered in the schema
                    comparison algorithm.
                </t>
            </section>
            <section anchor="local_refine" numbered="true" toc="default">
                <name>Refine</name>
                <t>
                    The “refine” statement is processed differently based on
                    whether the affected “grouping” is defined in an imported
                    module or the local YANG module. In the former case, when
                    the relevant grouping is imported, the “refine” is not
                    resolved and kept in the module. And then examined in the
                    comparison algorithm, similarly to the “deviation” statement.
                </t>
                <t>
                    However, all the “refine” statements targeting a local
                    “grouping” are applied on the nodes of the grouping when
                    the “uses” is resolved. After processing the “refine”
                    statements with all its substatements, they are effectively
                    removed from the locally resolved module to avoid reporting
                    changes of any “refine” statements twice.
                </t>
            </section>
            <section anchor="local_augment" numbered="true" toc="default">
                <name>Augment</name>
                <t>
                    All the “augment” statements are processed similarly to
                    “refine” statements. Meaning that augments of imported
                    groupings are not resolved and compared directly while
                    augments of local groupings are applied and then removed
                    from the module.
                </t>
            </section>
        </section>
        <section anchor="fully_resolved_schema" numbered="true" toc="default">
            <name>Fully resolved schema (set of modules)</name>
            <t>
                The fully resolved schema representation consists of one or
                more YANG modules. Each of these is fully resolved according to
                the rules of the YANG language meaning that every referenced
                statement, including to other imported modules, is resolved,
                unlike locally resolved modules. The result is one large tree
                with schema nodes of all the YANG modules. The comparison
                algorithm MAY then choose to compare top-level schema node
                subtrees belonging only to a single YANG module.
            </t>
            <t>
                Next, all the statements used only for syntactic abstraction
                that do not affect YANG instance data are removed. Note that
                the “description” or “units” statements are kept because they
                may influence the data. Also, “error-app-tag” and
                “error-message” statements remain in the fully resolved schema
                for applications to learn that the generated error information
                has changed.
            </t>
            <t>
                The steps taken when fully resolving a module include:
            </t>
            <ul spacing="normal">
                <li>
                    All submodules of a single module are merged to create one
                    large YANG module.
                </li>
                <li>
                    "Import" statements are resolved by finding the referenced
                    YANG modules and making their contents available.
                </li>
                <li>
                    "Uses" statements are replaced by the referenced
                    "groupings" and the YANG nodes they define.

                    Any “when” statement of the “uses” is moved down to all the
                    direct descendant schema nodes of the “grouping”.
                </li>
                <li>
                    Types referencing any "typedef" statements are replaced
                    with the actual type details.
                </li>
                <li>
                    Augments are resolved by placing the included YANG nodes in
                    their targets.

                    Any “when” statement of the “augment” is moved down to all
                    the direct descendant schema nodes of the “augment”.
                </li>
                <li>
                    "Deviation" and "refine" statements are applied by changing
                    the appropriate schema nodes.
                </li>
                <li>
                    All the "if-feature" statements are evaluated based on the
                    enabled "features" of implemented YANG modules and the
                    disabled schema nodes are removed.
                </li>
                <li>
                    All the extension-instances have a matching “extension”
                    defintion.
                </li>
            </ul>
            <t>
                After the resolution, the following statements are completely
                removed with their substatements:
            </t>
            <ul spacing="normal">
                <li>organization</li>
                <li>contact</li>
                <li>reference</li>
                <li>import</li>
                <li>include</li>
                <li>revision</li>
                <li>typedef</li>
                <li>grouping</li>
                <li>augment</li>
                <li>deviation</li>
                <li>feature</li>
                <li>if-feature</li>
                <li>refine</li>
                <li>extension</li>
            </ul>
            <t>
                Also, these schema nodes are removed but replaced with their
                schema node substatements:
            </t>
            <ul spacing="normal">
                <li>choice</li>
                <li>case</li>
            </ul>
            <t>
                The term “schema” was chosen instead of “module” on purpose
                because when statements are imported from external modules, the
                resulting schema then includes statements from several YANG
                modules. But the fully resolved schema representation of a
                module always includes only the top-level schema node trees of
                that module.
            </t>
            <t>
                Only a subset of the module update rules in
                <xref target="change_conformance" format="default"/> apply for
                the fully resolved schema. Specifically, the rules for removed
                statements cannot be applied but other present statements are
                processed normally.
            </t>
            <t>
                How the concrete set of YANG modules of a fully resolved schema
                is described is out of scope of this document. But suitable
                existing structures include YANG data of “ietf-yang-library” from
                <xref target="RFC8525" format="default"/> or
                “ietf-yang-package-instance” in
                <xref target="I-D.ietf-netmod-yang-packages" format="default"/>.
            </t>
        </section>
        <section anchor="choosing_representation" numbered="true" toc="default">
            <name>Choosing a schema representation</name>
            <t>
                Selecting a suitable schema representation for the comparison
                algorithm depends on the desired purpose. But for a complete
                set of changes, both the representations should be compared and
                their output merged to get the combined output of the two
                comparisons.
            </t>
            <t>
                YANG module authors will primarily be interested in the locally
                resolved module representation. Using it for the comparison
                algorithm will yield all the changes that occurred in the
                specific YANG module only while ignoring any possible changes
                in imported modules. This information can then directly be used
                to decide the correct semantic version of the new revision of
                this module. The rules for selecting versions are defined in
                <xref target="I-D.ietf-netmod-yang-semver" format="default"/>.
            </t>
            <t>
                Any YANG-based application handling YANG instance data always
                uses the fully resolved schema representation. So, when running
                the schema comparison algorithm with the intent of learning the
                changes in the corresponding valid YANG instance data of the
                module, this representation should be used. With some
                additional information, the output of this comparison can then
                also be used to transform valid data of the old schema revision
                to data valid for the new schema revision. All these tools and
                applications are typically clients or servers of YANG-driven
                protocols, e.g. NETCONF, RESTCONF, or gRPC.
            </t>
            <section anchor="representation_examples" numbered="true" toc="default">
                <name>Examples</name>
                <t>
                    To illustrate the different output of the comparison
                    algorithm each schema representation can generate for the
                    same YANG module changes, following are a few examples.
                </t>
                <t>
                    When a “typedef” or “grouping” name changes, the algorithm
                    for locally resolved module will detect the change and
                    report it as non-backwards-compatible. This is useful
                    especially when importing such a module to learn that any
                    references to the original statements will no longer be
                    valid. However, if using the fully resolved schema, this
                    difference will not be detected at all since it does not
                    affect YANG instance data corresponding to this module.
                </t>
                <t>
                    Another specific use-case is when a module with “uses” that
                    referenced an external “grouping” replaces that “uses” node
                    directly with schema nodes in the “grouping” effectively
                    resolving the “uses” similarly to a YANG module parser.
                    Such a change is non-backwards-compatible based on the YANG
                    1.1 updating rules and reported that way when using a
                    locally resolved module. But the fully resolved schemas
                    will be completely the same before and after the change so
                    the comparison algorithm will not generate any changes and
                    report full compatibility of the old and the new modules
                    with their instance data.
                </t>
            </section>
        </section>
    </section>
    <section anchor="comparison_algorithm" numbered="true" toc="default">
        <name>Comparison algorithm</name>
        <t>
            This algorithm is defined for individual locally resolved
            modules and fully resolved schemas. All the statements are
            compared with their content, recursively, in the old revision
            and the new revision of the module or schema. Depth-first
            search order for the statement traversal SHOULD be used.
        </t>
        <t>
            The non data definition statements are considered modified when
            their content is changed or any of their substatements are
            changed. If a statement is present in the old revision and
            missing in the new revision, it is considered removed.
            Conversely, if missing in the old revision but present in the
            new revision, it is considered added.
        </t>
        <t>
            Data definition statements are compared similarly except that a
            change in a descendant data definition statement is not
            considered a change of the parent data definition statement but
            a separate change instead.
        </t>
        <t>
            Only statements with any changes are reported and included in
            the comparison algorithm output.
        </t>
        <section anchor="module_identification" numbered="true" toc="default">
            <name>Module identification</name>
            <t>
                When generating the comparison output of two modules,
                unique identification of these modules SHOULD be included.
                For both the old and the new revision of the base module,
                its name, revision, list of submodules, and a leaf-list of
                enabled features is included. For the fully resolved
                schema, the same information is also reported for all the
                imported YANG modules, recursively. This ensures that if
                any other output is produced with a different set of
                changes for two fully resolved schemas, their
                identification information must also differ.
            </t>
        </section>
        <section anchor="change_conformance" numbered="true" toc="default">
            <name>Change conformance</name>
            <t>
                Every change is classified as editorial,
                backwards-compatible, or non-backwards-compatible. The
                classification is based on Section 11 of
                <xref target="RFC7950" format="default"/> which mentions
                most of the possible changes between two revisions of a
                YANG 1.1 module and Section 3.1 of
                <xref target="I-D.ietf-netmod-yang-module-versioning" format="default"/>
                adds more details about the exact conformance of statements
                with various "status" statement values. Finally,
                <xref target="I-D.ietf-netmod-yang-semver" format="default"/>
                defines what classifies as an editorial change.
            </t>
            <t>
                General non-normative explanation of change conformance
                classification can be found in
                <xref target="change_conformance_principles" format="default"/>.
            </t>
            <section anchor="conformance_devs_refines_augs" numbered="true" toc="default">
                <name>Deviations, Refines, and Augments</name>
                <t>
                    All the statement change conformance follows the
                    general rules above if these statements are present in
                    the schema representation, see
                    <xref target="schema_representations" format="default"/>.
                    But this clarification is added to make certain that
                    the rules are interpreted correctly.
                </t>
                <t>
                    Since “deviation” and “refine” statements are not among
                    the allowed statements that can be changed when
                    updating a module in Section 11 of
                    <xref target="RFC7950" format="default"/>, any
                    non-editorial change of these statements or their
                    substatements is treated as non-backwards-compatible.
                </t>
                <t>
                    But since “augment” statements can only add schema
                    nodes, these can be processed and compared normally.
                </t>
                <t>
                    So, for example, even if removing the “mandatory”
                    statement is considered backwards-compatible, a new
                    “deviation” removing the “mandatory” statement from its
                    target node is considered a non-backwards-compatible
                    change. Similarly a “refine” of the “description” of a
                    node is classified as non-backward-compatible change.
                    However, a change in the “description” of a “deviation”
                    statement is treated as a standard “description” change
                    because it describes the “deviation” statement itself
                    and does not affect the deviation target node.
                </t>
            </section>
            <section anchor="conformance_extensions" numbered="true" toc="default">
                <name>Conformance extensions</name>
                <t>
                    There are cases when it may be impossible for tooling
                    to accurately determine the conformance of a change but
                    a default conformance is always assumed for every
                    statement. The affected ambiguous statements with their
                    default conformances are:
                </t>
                <ul spacing="normal">
                    <li>pattern - NBC</li>
                    <li>when - NBC</li>
                    <li>must - NBC</li>
                    <li>description - Editorial</li>
                    <li>reference - Editorial</li>
                    <li>presence - Editorial</li>
                    <li>extension instance - BC</li>
                </ul>
                <t>
                    Normally, any modification of these statements is
                    reported with the default change conformance. However,
                    if the author of the new revision of a YANG module
                    determines that the change of one of the aforementioned
                    statements has a different conformance based on the
                    compatibility rules for the specific statement, they
                    can decide to use the special extension instances to
                    signify this fact. These are:
                </t>
                <ul spacing="normal">
                    <li>ed-change-at SEMVER</li>
                    <li>bc-change-at SEMVER</li>
                    <li>nbc-change-at SEMVER</li>
                </ul>
                <t>
                    They determine the conformance of the change of the
                    marked statement to be editorial, backwards-compatible,
                    or non-backwards-compatible, respectively. The argument
                    is a semantic version of the YANG module revision that
                    introduced the specific change and these extension
                    instances are sticky, meaning they remain in the module
                    even in its later revisions. Also, a YANG statement can
                    have multiple conformance extension statements. For
                    example, when a pattern changes in multiple versions of
                    a module, each change can be marked with an extension
                    to explicitly state the conformance of the change.
                </t>
            </section>
        </section>
        <section anchor="algorithm_variants_support" numbered="true" toc="default">
            <name>Algorithm variants support</name>
            <t>
                Tools implementing schema comparison SHOULD support
                comparing locally resolved modules, fully resolved schemas,
                and both representations together. In case the comparison
                generates YANG data for the
                "ietf-yang-schema-comparison-output" YANG module, simple
                XPath filters can be used to select any subset of changes.
            </t>
            <t>
                Data definition statements are present in both the locally
                resolved module and fully resolved schema. So if both
                representations are compared normally, there would be
                duplicate changes reported in the algorithm output. These
                duplicate changes MUST be avoided and filtered out.
            </t>
        </section>
    </section>
    <section anchor="yang_module_schema_cmp" numbered="true" toc="default">
        <name>Schema Comparison YANG Module</name>
        <t keepWithNext="true">
            YANG module with extensions for fine-tuning the classification
            of differences between two revisions of YANG schemas.
        </t>
        <sourcecode name="ietf-yang-schema-comparison@2026-09-02.yang" type=""
            markers="true"><![CDATA[
module ietf-yang-schema-comparison {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-yang-schema-comparison";
  prefix yscmp;

  organization
    "IETF NETMOD (Network Modeling) Working Group";
  contact
    "WG List: NETMOD WG list <mailto:netmod@ietf.org>
     WG Web:  https://datatracker.ietf.org/wg/netmod

     Author:  Michal Vaško
              <mailto:mvasko@cesnet.cz>

     Author:  Rob Wilton
              <mailto:rwilton@cisco.com>

     Author:  Per Andersson
              <mailto:per.ietf@ionio.se>";
  description
    "This YANG 1.1 module contains extensions to support comparison
     between different versions of YANG schemas.

     Copyright (c) 2026 IETF Trust and the persons identified as
     authors of the code.  All rights reserved.

     Redistribution and use in source and binary forms, with
     or without modification, is permitted pursuant to, and
     subject to the license terms contained in, the Revised
     BSD License set forth in Section 4.c of the IETF Trust's
     Legal Provisions Relating to IETF Documents
     (https://trustee.ietf.org/license-info).

     This version of this YANG module is part of RFC XXXX
     (https://www.rfc-editor.org/info/rfcXXXX); see the RFC
     itself for full legal notices.

     The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL',
     'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED',
     'NOT RECOMMENDED', 'MAY', and 'OPTIONAL' in this document
     are to be interpreted as described in BCP 14 (RFC 2119)
     (RFC 8174) when, and only when, they appear in all
     capitals, as shown here.";

  // RFC Ed.: update the date below with the date of RFC publication
  // and remove this note.
  // RFC Ed.: replace XXXX (inc above) with actual RFC number and
  // remove this note.

  revision 2026-09-02 {
    description
      "Initial revision.";
    reference
      "RFC XXXX: YANG Schema Comparison";
  }

  extension ed-change-at {
    argument semver;
    description
      "Marks statements in a new revision of a module
       that introduces an editorial change of the statement.

       The argument marks the most recent version of the
       module where the statement has been changed.

       Can only be a substatement of 'pattern', 'when',
       'must', 'description', 'reference', 'presence', or
       extension instance statements.";
    reference
      "RFC 7950: The YANG 1.1 Data Modeling Language, section 11;
       RFC 6020: YANG - A Data Modeling Language for the Network
       Configuration Protocol (NETCONF), section 10";
  }

  extension bc-change-at {
    argument semver;
    description
      "Marks statements in a new revision of a module
       that introduces a backwards-compatible change of
       the statement.

       The argument marks the most recent version of the
       module where the statement has been changed.

       Can only be a substatement of 'pattern', 'when',
       'must', 'description', 'reference', 'presence', or
       extension instance statements.";
    reference
      "RFC 7950: The YANG 1.1 Data Modeling Language, section 11;
       RFC 6020: YANG - A Data Modeling Language for the Network
       Configuration Protocol (NETCONF), section 10";
  }

  extension nbc-change-at {
    argument semver;
    description
      "Marks statements in a new revision of a module
       that introduces a non-backwards-compatible change of
       the statement.

       The argument marks the most recent version of the
       module where the statement has been changed.

       Can only be a substatement of 'pattern', 'when',
       'must', 'description', 'reference', 'presence', or
       extension instance statements.";
    reference
      "RFC 7950: The YANG 1.1 Data Modeling Language, section 11;
       RFC 6020: YANG - A Data Modeling Language for the Network
       Configuration Protocol (NETCONF), section 10";
  }
}
]]></sourcecode>
    </section>
    <section anchor="contributor" numbered="true" toc="default">
      <name>Contributors</name>
      <t>This document grew out of the YANG module versioning design team that
  was formed after IETF 101. The following individuals are (or have been) members
  of the design team and have contributed on the YANG versioning project:</t>
      <ul spacing="normal">
        <li>Balazs Lengyel</li>
        <li>Benoit Claise</li>
        <li>Bo Wu</li>
        <li>Ebben Aries</li>
        <li>Jason Sterne</li>
        <li>Joe Clarke</li>
        <li>Juergen Schoenwaelder</li>
        <li>Mahesh Jethanandani</li>
        <li>Michael Wang</li>
        <li>Qin Wu</li>
        <li>Reshad Rahman</li>
        <li>Rob Wilton</li>
        <li>Jan Lindblad</li>
        <li>Per Andersson</li>
      </ul>
      <t>The idea of a tooling-based comparison of YANG module revisions was
   first described in <xref target="I-D.clacla-netmod-yang-model-update"/>.
   This document builds on those initial ideas.</t>
    </section>
    <section anchor="security" numbered="true" toc="default">
        <name>Security Considerations</name>
        <t>
            This section is modeled after the template described in Section 3.7.1
            of <xref target="RFC9907"/>.
        </t>
        <t>
            The YANG modules specified in this document define extensions
            ("ietf-yang-schema-comparison") and a schema for data
            ("ietf-yang-schema-comparison-output") that are designed to be used
            by offline tooling to generate output describing the differences
            between two supplied YANG modules.
        </t>
        <t>
            The YANG module specified in this document MAY be accessed via
            network management protocols such as NETCONF
            <xref target="RFC6241"/> or RESTCONF <xref target="RFC8040"/>. The
            lowest NETCONF layer is the secure transport layer, and the
            mandatory-to-implement secure transport is Secure Shell (SSH)
            <xref target="RFC6242"/>. The lowest RESTCONF layer is HTTPS, and
            the mandatory-to-implement secure transport is TLS
            <xref target="RFC8446"/>.
        </t>
        <t>
            The Network Configuration Access Control Model (NACM)
            <xref target="RFC8341"/> provides the means to restrict access for
            particular NETCONF or RESTCONF users to a preconfigured subset of
            all available NETCONF or RESTCONF protocol operations and content.
        </t>
        <t>
            When the module is used by offline tooling, there are no security
            considerations, since the user has full access to all YANG modules
            being used.
        </t>
        <t>
            The "schema-comparison" structure defined in the
            "ietf-yang-schema-comparison-output" module contains all the
            groupings reflecting the changes between YANG modules. If instances
            of this structure are generated or published by online tooling,
            care needs to be taken so that information about non-public YANG
            modules is not inadvertently disclosed.
        </t>
        <t>
            Since the module does not define any RPCs, actions, or
            notifications, the security considerations for such statements are
            not provided here.
        </t>
    </section>
    <section anchor="iana" numbered="true" toc="default">
      <name>IANA Considerations</name>
      <section anchor="xml-registry" numbered="true" toc="default">
        <name>The "IETF XML" Registry</name>
        <t>This document registers two URIs in the "ns" subregistry of
          the IETF XML Registry <xref target="RFC3688"/>
          maintained at <eref target="https://www.iana.org/assignments/xml-registry/xml-registry.xhtml#ns"/>.
          Following the format defined in <xref target="RFC3688"/>,
          the following registrations are requested:</t>
        <t>
          <figure align="center">
            <artwork>
URI: urn:ietf:params:xml:ns:yang:ietf-yang-schema-comparison
Registrant Contact: The IESG.
XML: N/A, the requested URI is an XML namespace.

URI: urn:ietf:params:xml:ns:yang:ietf-yang-schema-comparison-output
Registrant Contact: The IESG.
XML: N/A, the requested URI is an XML namespace.
            </artwork>
          </figure>
        </t>
      </section>
      <section anchor="yang-module-registrations" numbered="true" toc="default">
        <name>The "YANG Module Names" Registry</name>
        <t>This document registers two YANG modules in the YANG Module Names
          registry <xref target="RFC6020" format="default"/> maintained at
          <eref target="https://www.iana.org/assignments/yang-parameters/yang-paramaters.xhtml"/>.
          Following the format defined in <xref target="RFC6020"/>, the following
          registrations are requested:
        </t>
        <t>
          <figure align="center">
            <artwork>
   Name: ietf-yang-schema-comparison
   XML Namespace: urn:ietf:params:xml:ns:yang:ietf-yang-schema-comparison
   Prefix: schema-cmp
   Reference: RFC XXXX

   Name: ietf-yang-schema-comparison-output
   XML Namespace: urn:ietf:params:xml:ns:yang:ietf-yang-schema-comparison-output
   Prefix: schema-cmp-out
   Reference: RFC XXXX
            </artwork>
          </figure>
        </t>
      </section>
    </section>
  </middle>
  <back>
    <references title="Normative References">
        <?rfc include='reference.RFC.2119'?>
        <?rfc include='reference.RFC.3688'?>
        <?rfc include='reference.RFC.6020'?>
        <?rfc include='reference.RFC.6241'?>
        <?rfc include='reference.RFC.6242'?>
        <?rfc include='reference.RFC.6991'?>
        <?rfc include='reference.RFC.7950'?>
        <?rfc include='reference.RFC.7951'?>
        <?rfc include='reference.RFC.8040'?>
        <?rfc include='reference.RFC.8174'?>
        <?rfc include='reference.RFC.8341'?>
        <?rfc include='reference.RFC.8446'?>
        <?rfc include='reference.RFC.8525'?>
        <?rfc include='reference.RFC.8791'?>
        <?rfc include='reference.RFC.9907'?>
        <?ref include='reference.I-D.ietf-netmod-yang-semver'?>
        <?ref include='reference.I-D.ietf-netmod-yang-module-versioning'?>
        <?ref include='reference.I-D.ietf-netmod-yang-packages'?>
    </references>
    <references title="Informative References">
        <?ref include='reference.I-D.clacla-netmod-yang-model-update'?>
    </references>
    <section anchor="yang_module_schema_cmp_out">
        <name>Schema Comparison Algorithm Output YANG Module</name>
        <t keepWithNext="true">
            This YANG module defines the specific output of the schema
            comparison algorithm, supporting comparison of the locally
            resolved module, fully resolved schema, or both. The
            "ietf-yang-schema-comparison-output" YANG module imports
            definitions from the "ietf-yang-types" module defined in
            <xref target="RFC6991"/>, the "ietf-yang-library" module defined in
            <xref target="RFC8525"/>, and the "ietf-yang-structure-ext" module
            defined in <xref target="RFC8791"/>.
        </t>
        <t>
            Generating schema comparison data in the form of YANG instance data
            compliant with this YANG module is optional but makes it easier for
            further automatic processing by tools and also allows for simple
            filtering of the data.
        </t>
        <t>
            Non data definition statements are uniquely identified with their
            YANG identifier and data definition statements with their absolute
            schema node-ids. For every change, the changed statement and the
            parent of the changed statement are included. While redundant in
            many cases, it allows the algorithm to uniquely report changes in
            nested statements, e.g. an extension instance change in the type of
            a leaf statement. Also, all the unchanged substatements with their
            value or content are included for every changed statement, for both
            the older and the newer revision of the YANG module, if applicable.
            This ensures that the output includes all the possibly required
            information without relying on learning it from the YANG modules
            themselves.
        </t>
        <sourcecode name="ietf-yang-schema-comparison-output@2026-09-02.yang" type=""
            markers="true"><![CDATA[
module ietf-yang-schema-comparison-output {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-yang-schema-comparison-output";
  prefix yscmp-out;

  import ietf-yang-types {
    prefix yang;
    reference
      "RFC 6991: Common YANG Data types";
  }
  import ietf-yang-library {
    prefix yanglib;
    reference
      "RFC 8525: YANG Library";
  }
  import ietf-yang-structure-ext {
    prefix sx;
    reference
      "RFC 8791: YANG Data Structure Extensions";
  }
  import ietf-yang-semver {
    prefix ysv;
    reference
      "RFC XXXX: YANG Semantic Versioning";
  }

  organization
    "IETF NETMOD (Network Modeling) Working Group";
  contact
    "WG List: NETMOD WG list <mailto:netmod@ietf.org>
     WG Web:  https://datatracker.ietf.org/wg/netmod

     Author:  Michal Vaško
              <mailto:mvasko@cesnet.cz>

     Author:  Rob Wilton
              <mailto:rwilton@cisco.com>

     Author:  Per Andersson
              <mailto:per.ietf@ionio.se>";
  description
    "This YANG 1.1 module contains definitions of output of comparison
     between different versions of YANG schemas. The base schema nodes
     describe changes in a compiled YANG module with all of its
     included submodules and imported modules. The rest of the schema
     nodes are optional and describe changes in all the statements of a
     single YANG module.

     Copyright (c) 2026 IETF Trust and the persons identified as
     authors of the code.  All rights reserved.

     Redistribution and use in source and binary forms, with
     or without modification, is permitted pursuant to, and
     subject to the license terms contained in, the Revised
     BSD License set forth in Section 4.c of the IETF Trust's
     Legal Provisions Relating to IETF Documents
     (https://trustee.ietf.org/license-info).

     This version of this YANG module is part of RFC XXXX
     (https://www.rfc-editor.org/info/rfcXXXX); see the RFC
     itself for full legal notices.

     The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL',
     'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED',
     'NOT RECOMMENDED', 'MAY', and 'OPTIONAL' in this document
     are to be interpreted as described in BCP 14 (RFC 2119)
     (RFC 8174) when, and only when, they appear in all
     capitals, as shown here.";

  // RFC Ed.: update the date below with the date of RFC publication
  // and remove this note.
  // RFC Ed.: replace XXXX (inc above) with actual RFC number and
  // remove this note.

  revision 2026-09-02 {
    description
      "Initial revision.";
    reference
      "RFC XXXX: YANG Schema Comparison";
  }

  typedef schema-node-path {
    type string;
    description
      "Node schema path (node-id). A generic type is used to not enforce
       their evaluation or validation in this context.";
  }

  typedef schema-stmt-path {
    type string;
    description
      "Path to a statement. Any non data node parents are encoded
       specially.";
  }

  typedef stmt-type {
    type enumeration {
      enum base {
        description
          "YANG statement 'base'.";
      }
      enum bit {
        description
          "YANG statement 'bit'.";
      }
      enum config {
        description
          "YANG statement 'config'.";
      }
      enum contact {
        description
          "YANG statement 'contact'.";
      }
      enum default {
        description
          "YANG statement 'default'.";
      }
      enum description {
        description
          "YANG statement 'description'.";
      }
      enum enum {
        description
          "YANG statement 'enum'.";
      }
      enum error-app-tag {
        description
          "YANG statement 'error-app-tag'.";
      }
      enum error-message {
        description
          "YANG statement 'error-message'.";
      }
      enum extension {
        description
          "YANG statement 'extension'.";
      }
      enum extension-instance {
        description
          "Any extension instance YANG statement.";
      }
      enum feature {
        description
          "YANG statement 'feature'.";
      }
      enum fraction-digits {
        description
          "YANG statement 'fraction-digits'.";
      }
      enum identity {
        description
          "YANG statement 'identity'.";
      }
      enum if-feature {
        description
          "YANG statement 'if-feature'.";
      }
      enum import {
        description
          "YANG statement 'import'.";
      }
      enum include {
        description
          "YANG statement 'include'.";
      }
      enum length {
        description
          "YANG statement 'length'.";
      }
      enum mandatory {
        description
          "YANG statement 'mandatory'.";
      }
      enum max-elements {
        description
          "YANG statement 'max-elements'.";
      }
      enum min-elements {
        description
          "YANG statement 'min-elements'.";
      }
      enum must {
        description
          "YANG statement 'must'.";
      }
      enum node {
        description
          "YANG statement 'container', 'leaf', 'leaf-list', 'list',
           'anydata', 'anyxml', 'rpc', 'action', or 'notification'.
           If the locally resolved module is also compared, it can
           additionally be 'choice', 'case', 'input', 'output',
           'uses', 'augment', or 'grouping'.";
      }
      enum ordered-by {
        description
          "YANG statement 'ordered-by'.";
      }
      enum organization {
        description
          "YANG statement 'organization'.";
      }
      enum path {
        description
          "YANG statement 'path'.";
      }
      enum pattern {
        description
          "YANG statement 'pattern'.";
      }
      enum prefix {
        description
          "YANG statement 'prefix'.";
      }
      enum presence {
        description
          "YANG statement 'presence'.";
      }
      enum range {
        description
          "YANG statement 'range'.";
      }
      enum reference {
        description
          "YANG statement 'reference'.";
      }
      enum refine {
        description
          "YANG statement 'refine'.";
      }
      enum require-instance {
        description
          "YANG statement 'require-instance'.";
      }
      enum revision-date {
        description
          "YANG statement 'revision-date'.";
      }
      enum status {
        description
          "YANG statement 'status'.";
      }
      enum type {
        description
          "YANG statement 'type'.";
      }
      enum typedef {
        description
          "YANG statement 'typedef'.";
      }
      enum units {
        description
          "YANG statement 'units'.";
      }
      enum unique {
        description
          "YANG statement 'unique'.";
      }
      enum when {
        description
          "YANG statement 'when'.";
      }
      enum yang-version {
        description
          "YANG statement 'yang-version'.";
      }
    }
    description
      "Type of the statement that a change affects.";
  }

  typedef revision-or-empty {
    type union {
      type empty;
      type yanglib:revision-identifier;
    }
    description
      "Module or submodule revision. If it has none, an empty value is used.";
  }

  grouping if-feature-stmts {
    description
      "Describes changes of all the if-features on a statement.";
    leaf-list if-feature {
      type string;
      description
        "Value of an if-feature statement.";
    }
  }

  grouping ext-instance-stmt {
    description
      "Describes changes of an extension instance.";
    leaf module {
      type yang:yang-identifier;
      mandatory true;
      description
        "Module with the extension definition of an extension
         instance.";
    }
    leaf name {
      type yang:yang-identifier;
      mandatory true;
      description
        "Name of the extension definition of an extension instance.";
    }
    leaf argument {
      type string;
      description
        "Argument used of an extension definition.";
    }
    anydata substatements {
      description
        "Any substatements of the extension instance.";
    }
  }

  grouping ext-instance-stmts {
    description
      "Describes changes of all the extension instances.";
    list ext-instance {
      description
        "List of extension-instance substatements.";
      uses ext-instance-stmt;
    }
  }

  grouping status-stmt {
    description
      "Describes a status statement change.";
    leaf status {
      type enumeration {
        enum current {
          description
            "Current effective status of a statement.";
        }
        enum deprecated {
          description
            "Deprecated effective status of a statement.";
        }
        enum obsolete {
          description
            "Obsolete effective status of a statement.";
        }
      }
      mandatory true;
      description
        "Status substatement value.";
    }
  }

  grouping must-stmts {
    description
      "Describes changes of all the must statements of a specific parent
       statement.";
    list must {
      description
        "List of must substatements.";
      leaf condition {
        type string;
        description
          "Condition substatement value.";
      }
      uses restriction-substmts;
    }
  }

  grouping when-stmts {
    description
      "Describes changes of all the when statements of a specific parent
       statement.";
    list when {
      description
        "List of when substatements.";
      leaf condition {
        type string;
        description
          "Condition substatement value.";
      }
      leaf description {
        type string;
        description
          "Description substatement value.";
      }
      leaf reference {
        type string;
        description
          "Reference substatement value.";
      }
      uses status-stmt;
      uses ext-instance-stmts;
    }
  }

  grouping restriction-substmts {
    description
      "Common substatements shared by all restriction statements.";
    leaf description {
      type string;
      description
        "Description substatement value.";
    }
    leaf reference {
      type string;
      description
        "Reference substatement value.";
    }
    leaf error-message {
      type string;
      description
        "Error-message substatement value.";
    }
    leaf error-app-tag {
      type string;
      description
        "Error-app-tag substatement value.";
    }
    uses ext-instance-stmts;
  }

  grouping type-substmts {
    description
      "Describes a type statement change.";
    leaf base-type {
      type enumeration {
        enum int8 {
          description
            "YANG built-in type 'int8'.";
        }
        enum int16 {
          description
            "YANG built-in type 'int16'.";
        }
        enum int32 {
          description
            "YANG built-in type 'int32'.";
        }
        enum int64 {
          description
            "YANG built-in type 'int64'.";
        }
        enum uint8 {
          description
            "YANG built-in type 'uint8'.";
        }
        enum uint16 {
          description
            "YANG built-in type 'uint16'.";
        }
        enum uint32 {
          description
            "YANG built-in type 'uint32'.";
        }
        enum uint64 {
          description
            "YANG built-in type 'uint64'.";
        }
        enum decimal64 {
          description
            "YANG built-in type 'decimal64'.";
        }
        enum string {
          description
            "YANG built-in type 'string'.";
        }
        enum boolean {
          description
            "YANG built-in type 'boolean'.";
        }
        enum enumeration {
          description
            "YANG built-in type 'enumeration'.";
        }
        enum bits {
          description
            "YANG built-in type 'bits'.";
        }
        enum binary {
          description
            "YANG built-in type 'binary'.";
        }
        enum leafref {
          description
            "YANG built-in type 'leafref'.";
        }
        enum identityref {
          description
            "YANG built-in type 'identityref'.";
        }
        enum empty {
          description
            "YANG built-in type 'empty'.";
        }
        enum union {
          description
            "YANG built-in type 'union'.";
        }
        enum instance-identifier {
          description
            "YANG built-in type 'instance-identifier'.";
        }
      }
      description
        "Type substatement value.";
    }
    container range {
      description
        "Range statement substatements.";
      list interval {
        description
          "Intervals of a range statement.";
        leaf min {
          type int64;
          description
            "Lower boundary of an interval of a range statement.";
        }
        leaf max {
          type int64;
          description
            "Upper boundary of an interval of a range statement.";
        }
      }
      uses restriction-substmts;
    }
    container length {
      description
        "Length statement substatements.";
      list interval {
        description
          "Intervals of a length statement.";
        leaf min {
          type uint64;
          description
            "Lower boundary of an interval of a length statement.";
        }
        leaf max {
          type uint64;
          description
            "Upper boundary of an interval of a length statement.";
        }
      }
      uses restriction-substmts;
    }
    leaf fraction-digits {
      type uint8;
      description
        "Fraction-digits substatement value.";
    }
    list pattern {
      description
        "List of pattern statements.";
      leaf expression {
        type string;
        description
          "Pattern substatement value.";
      }
      leaf inverted {
        type boolean;
        description
          "A value of true indicates that the pattern's 'modifier'
           substatement is 'invert-match'.";
        reference
          "RFC 7950 Section 9.4.6";
      }
      uses restriction-substmts;
    }
    list enum {
      key "name";
      ordered-by user;
      description
        "List of enum statements. Keeps the same order of the statements
         as in the module.";
      leaf name {
        type yang:yang-identifier;
        description
          "Enum statement name.";
      }
      uses if-feature-stmts {
        description
          "Populated only for locally resolved module.";
      }
      leaf description {
        type string;
        description
          "Description substatement value.";
      }
      leaf reference {
        type string;
        description
          "Reference substatement value.";
      }
      leaf value {
        type int32;
        description
          "Value substatement value.";
      }
      uses status-stmt;
      uses ext-instance-stmts;
    }
    list bit {
      key "name";
      ordered-by user;
      description
        "List of bit statements. Keeps the same order of the statements
         as in the module.";
      leaf name {
        type yang:yang-identifier;
        description
          "Bit statement name.";
      }
      uses if-feature-stmts {
        description
          "Populated only for locally resolved module.";
      }
      leaf description {
        type string;
        description
          "Description substatement value.";
      }
      leaf reference {
        type string;
        description
          "Reference substatement value.";
      }
      leaf position {
        type uint32;
        description
          "Position substatement value.";
      }
      uses status-stmt;
      uses ext-instance-stmts;
    }
    leaf path {
      type string;
      description
        "Path substatement value.";
    }
    leaf require-instance {
      type boolean;
      description
        "Require-instance substatement value.";
    }
    leaf-list base {
      type yang:yang-identifier;
      description
        "List of base substatement values.";
    }
    uses ext-instance-stmts;
  }

  grouping type-local-substmts {
    description
      "Describes a locally resolved module type statement change.";
    leaf name {
      type yang:yang-identifier;
      description
        "Type argument substatement value.";
    }
    container range {
      description
        "Range statement substatements.";
      leaf restriction {
        type string;
        description
          "Range argument substatement value.";
      }
      uses restriction-substmts;
    }
    container length {
      description
        "Length statement substatements.";
      leaf restriction {
        type string;
        description
          "Length argument substatement value.";
      }
      uses restriction-substmts;
    }
    leaf fraction-digits {
      type uint8;
      description
        "Fraction-digits substatement value.";
    }
    list pattern {
      description
        "List of pattern statements.";
      leaf expression {
        type string;
        description
          "Pattern substatement value.";
      }
      leaf inverted {
        type empty;
        description
          "Presence indicates that the pattern's 'modifier'
           substatement is 'invert-match'.";
        reference
          "RFC 7950 Section 9.4.6";
      }
      uses restriction-substmts;
    }
    list enum {
      key "name";
      ordered-by user;
      description
        "List of enum statements. Keeps the same order of the statements
         as in the module.";
      leaf name {
        type yang:yang-identifier;
        description
          "Enum statement name.";
      }
      uses if-feature-stmts;
      leaf description {
        type string;
        description
          "Description substatement value.";
      }
      leaf reference {
        type string;
        description
          "Reference substatement value.";
      }
      leaf value {
        type int32;
        description
          "Value substatement value.";
      }
      uses status-stmt;
      uses ext-instance-stmts;
    }
    list bit {
      key "name";
      ordered-by user;
      description
        "List of bit statements. Keeps the same order of the statements
         as in the module.";
      leaf name {
        type yang:yang-identifier;
        description
          "Bit statement name.";
      }
      uses if-feature-stmts;
      leaf description {
        type string;
        description
          "Description substatement value.";
      }
      leaf reference {
        type string;
        description
          "Reference substatement value.";
      }
      leaf position {
        type uint32;
        description
          "Position substatement value.";
      }
      uses status-stmt;
      uses ext-instance-stmts;
    }
    leaf path {
      type string;
      description
        "Path substatement value.";
    }
    leaf require-instance {
      type boolean;
      description
        "Require-instance substatement value.";
    }
    leaf-list base {
      type yang:yang-identifier;
      description
        "List of base substatement values.";
    }
    uses ext-instance-stmts;
  }

  grouping refine-node-substmts {
    description
      "All substatements of a data-definition node that can be changed
       by a refine statement.";
    uses must-stmts;
    leaf-list default {
      type string;
      description
        "List of default substatement values.";
    }
    leaf config {
      type boolean;
      description
        "Config substatement value.";
    }
    leaf mandatory {
      type boolean;
      description
        "Mandatory substatement value.";
    }
    leaf min-elements {
      type uint32;
      description
        "Min-elements substatement value.";
    }
    leaf max-elements {
      type uint32;
      description
        "Max-elements substatement value.";
    }
  }

  grouping node-substmts {
    description
      "All substatements of a data-definition node.";
    uses if-feature-stmts {
      when "../../locally-resolved";
    }
    uses when-stmts;
    leaf description {
      type string;
      description
        "Description substatement value.";
    }
    leaf reference {
      type string;
      description
        "Reference substatement value.";
    }
    uses status-stmt;
    uses refine-node-substmts;
    leaf-list key {
      type yang:yang-identifier;
      description
        "Leaf-list of nodes referenced by a key statement.";
    }
    leaf ordered-by {
      type enumeration {
        enum system {
          description
            "System-ordered list or leaf-list of items.";
        }
        enum user {
          description
            "User-ordered list or leaf-list of items.";
        }
      }
      description
        "Ordered-by substatement value.";
    }
    container type {
      description
        "Type substatement.";
      uses type-substmts;
      list union-type {
        description
          "List of a union type substatements.";
        uses type-substmts;
      }
    }
    leaf units {
      type string;
      description
        "Units substatement value.";
    }
    list unique {
      description
        "List of unique substatements.";
      leaf-list node {
        type yang:yang-identifier;
        description
          "List of nodes referenced by a unique substatement.";
      }
    }
    leaf presence {
      type boolean;
      description
        "Indicates whether a presence substatement is defined for
         the container in the compiled schema. The textual argument
         of 'presence' is reported via the locally resolved module
         comparison (see the 'presence' leaf in 'local-substmts').";
    }
    uses ext-instance-stmts;
  }

  grouping module-substmts {
    description
      "All non-data-definition substatements of a module.";
    leaf yang-version {
      type string;
      description
        "YANG version substatement value.";
    }
    leaf prefix {
      when "../../../locally-resolved";
      type string;
      description
        "Prefix substatement value.";
    }
    container import {
      when "../../../locally-resolved";
      presence "Exists only when there is a difference in this import.";
      description
        "Import substatements.";
      leaf module {
        type yang:yang-identifier;
        mandatory true;
        description
          "Imported module.";
      }
      leaf prefix {
        type yang:yang-identifier;
        mandatory true;
        description
          "Imported module prefix.";
      }
      leaf revision-date {
        type yanglib:revision-identifier;
        description
          "Imported module revision-date.";
      }
      leaf description {
        type string;
        description
          "Description substatement value.";
      }
      leaf reference {
        type string;
        description
          "Reference substatement value.";
      }
      uses ext-instance-stmts;
    }
    container include {
      when "../../../locally-resolved";
      presence
        "Exists only when there is a difference in this include.";
      description
        "Include substatements.";
      leaf submodule {
        type yang:yang-identifier;
        mandatory true;
        description
          "Included submodule.";
      }
      leaf revision-date {
        type yanglib:revision-identifier;
        description
          "Included submodule revision-date.";
      }
      leaf description {
        type string;
        description
          "Description substatement value.";
      }
      leaf reference {
        type string;
        description
          "Reference substatement value.";
      }
      uses ext-instance-stmts;
    }
    leaf organization {
      type string;
      description
        "Organization substatement value.";
    }
    leaf contact {
      type string;
      description
        "Contact substatement value.";
    }
    leaf description {
      type string;
      description
        "Description substatement value.";
    }
    leaf reference {
      type string;
      description
        "Reference substatement value.";
    }
    container extension {
      when "../../../locally-resolved";
      presence
        "Exists only when there is a difference in this extension.";
      description
        "Extension substatements.";
      leaf name {
        type yang:yang-identifier;
        mandatory true;
        description
          "Extension name.";
      }
      leaf argument {
        type yang:yang-identifier;
        description
          "Argument substatement value.";
      }
      uses status-stmt;
      leaf description {
        type string;
        description
          "Description substatement value.";
      }
      leaf reference {
        type string;
        description
          "Reference substatement value.";
      }
      uses ext-instance-stmts;
    }
    container feature {
      when "../../../locally-resolved";
      presence
        "Exists only when there is a difference in this feature.";
      description
        "Feature substatements.";
      leaf name {
        type yang:yang-identifier;
        mandatory true;
        description
          "Feature name.";
      }
      uses if-feature-stmts;
      uses status-stmt;
      leaf description {
        type string;
        description
          "Description substatement value.";
      }
      leaf reference {
        type string;
        description
          "Reference substatement value.";
      }
      uses ext-instance-stmts;
    }
    container identity {
      description
        "Identity substatements.";
      leaf name {
        type yang:yang-identifier;
        mandatory true;
        description
          "Identity statement name.";
      }
      uses if-feature-stmts {
        when "../../../locally-resolved";
      }
      leaf-list base {
        when "../../../../locally-resolved";
        type yang:yang-identifier;
        description
          "List of bases of an identity.";
      }
      uses ext-instance-stmts;
    }
    container ext-instance {
      presence
        "Exists only when there is a difference in this
         extension-instance.";
      description
        "Extension-instance substatements.";
      uses ext-instance-stmt;
    }
  }

  grouping local-substmts {
    description
      "All locally-resolved-module-only statements that can be direct
       substatements of a module or nested in a node.";
    uses if-feature-stmts;
    uses when-stmts;
    leaf description {
      type string;
      description
        "Description substatement value.";
    }
    leaf reference {
      type string;
      description
        "Reference substatement value.";
    }
    uses status-stmt;
    uses refine-node-substmts;
    container type {
      description
        "Type substatement.";
      uses type-local-substmts;
      list union-type {
        description
          "List of a union type substatements.";
        uses type-local-substmts;
      }
    }
    leaf units {
      type string;
      description
        "Units substatement value.";
    }
    leaf presence {
      type string;
      description
        "Presence substatement value.";
    }
    uses ext-instance-stmts;
  }

  grouping conformance-type {
    description
      "Conformance type of a change.";
    leaf conformance {
      type enumeration {
        enum editorial {
          description
            "Editorial change.";
        }
        enum backwards-compatible {
          description
            "Backwards-compatible change.";
        }
        enum non-backwards-compatible {
          description
            "Non-backwards-compatible change.";
        }
      }
      mandatory true;
      description
        "Conformance information of a change in the compared YANG
         modules.";
    }
  }

  grouping change-info {
    description
      "Details of a single change.";
    list changed {
      key "stmt";
      min-elements 1;
      description
        "List of changes.";
      leaf stmt {
        type stmt-type;
        description
          "Changed statement.";
      }
      leaf parent-stmt {
        type stmt-type;
        description
          "Parent statement of the changed statement.";
      }
      leaf change {
        type enumeration {
          enum modified {
            description
              "Statement existed and was modified.";
          }
          enum added {
            description
              "Statement was added.";
          }
          enum removed {
            description
              "Statement was removed.";
          }
          enum moved {
            description
              "Statement was moved and the position affects the
               meaning.";
          }
        }
        mandatory true;
        description
          "Type of change of the statement.";
      }
      uses conformance-type;
    }
  }

  grouping module-params {
    description
      "Identification details of a processed YANG module.";
    leaf module {
      type yang:yang-identifier;
      description
        "Compared module name.";
    }
    leaf revision {
      type revision-or-empty;
      description
        "Compared module revision.";
    }
    leaf version {
      type ysv:version;
      description
        "Compared module semantic version, if defined.";
    }
    list submodule {
      key "name revision";
      leaf name {
        type yang:yang-identifier;
        description
          "Submodule name.";
      }
      leaf revision {
        type revision-or-empty;
        description
          "Submodule revision.";
      }
      description
        "Submodule of the main module.";
    }
    leaf-list enabled-feature {
      type yang:yang-identifier;
      description
        "All the enabled features of the module.";
    }
  }

  grouping local-info {
    description
      "Information about all the changed locally-resolved-module-only statements.";
    list local-comparison {
      description
        "Information about locally-resolved-module-only statement changes.";
      leaf parent-path {
        type schema-stmt-path;
        description
          "Path to the parent statement. Not set if a direct
           substatement of module or submodule.";
      }
      leaf identifier {
        type string;
        mandatory true;
        description
          "Identifier of the statement, may include a prefix.";
      }
      leaf stmt-type {
        type enumeration {
          enum choice {
            description
              "YANG statement 'choice' node.";
          }
          enum case {
            description
              "YANG statement 'case' node.";
          }
          enum input {
            description
              "YANG statement 'input' node.";
          }
          enum output {
            description
              "YANG statement 'output' node.";
          }
          enum uses {
            description
              "YANG statement 'uses' node.";
          }
          enum grouping {
            description
              "YANG statement 'grouping' node.";
          }
          enum augment {
            description
              "YANG statement 'augment' node.";
          }
          enum refine {
            description
              "YANG statement 'refine' node.";
          }
          enum typedef {
            description
              "YANG statement 'typedef'.";
          }
        }
        mandatory true;
        description
          "Type of the changed data-definition statement.";
      }
      uses change-info;
      container old {
        description
          "Changed local statements in the older revision of the YANG
           module.";
        uses local-substmts;
      }
      container new {
        description
          "Changed local statements in the newer revision of the YANG
           module.";
        uses local-substmts;
      }
    }
  }

  grouping node-info {
    description
      "Information about all the changed nodes.";
    list node-comparison {
      key "node";
      ordered-by user;
      description
        "Information about data-definition (node) statement substatement
         changes. Keeps the traversed order of the nodes by the
         algorithm. It SHOULD follow the depth-first search order.";
      leaf node {
        type schema-node-path;
        description
          "Path to the changed data-definition statement.";
      }
      leaf node-type {
        type enumeration {
          enum container {
            description
              "YANG statement 'container' node.";
          }
          enum leaf {
            description
              "YANG statement 'leaf' node.";
          }
          enum leaf-list {
            description
              "YANG statement 'leaf-list' node.";
          }
          enum list {
            description
              "YANG statement 'list' node.";
          }
          enum anydata {
            description
              "YANG statement 'anydata' node.";
          }
          enum anyxml {
            description
              "YANG statement 'anyxml' node.";
          }
          enum rpc {
            description
              "YANG statement 'rpc' node.";
          }
          enum action {
            description
              "YANG statement 'action' node.";
          }
          enum notification {
            description
              "YANG statement 'notification' node.";
          }
        }
        mandatory true;
        description
          "Type of the changed data-definition statement.";
      }
      uses change-info;
      container old {
        description
          "All the node substatements in the older revision of the YANG
           module.";
        uses node-substmts;
      }
      container new {
        description
          "All the node substatements in the newer revision of the YANG
           module.";
        uses node-substmts;
      }
    }
  }

  sx:structure schema-comparison {
    description
      "Schema comparison details.";
    list comparison {
      must "locally-resolved or fully-resolved" {
        description
          "As the comparison input, locally resolved module, fully
           resolved module, or both must be used.";
      }
      description
        "Instance of a schema comparison of 2 YANG modules in different
         revisions with all their imports.";
      leaf locally-resolved {
        type empty;
        description
          "Locally resolved module has been used for the comparison.";
        reference
          "RFC XXXX Section 3.1.";
      }
      leaf fully-resolved {
        type empty;
        description
          "Fully resolved schema has been used for the comparison.";
        reference
          "RFC XXXX Section 3.2.";
      }
      container source {
        description
          "Source module information.";
        uses module-params;
      }
      list source-import {
        when "../fully-resolved";
        key "module revision";
        description
          "List of source module imported modules information.";
        uses module-params;
      }
      container target {
        description
          "Target module information.";
        uses module-params;
      }
      list target-import {
        when "../fully-resolved";
        key "module revision";
        description
          "List of target module imported modules information.";
        uses module-params;
      }
      uses conformance-type;
      list module-comparison {
        description
          "Information about direct module statement substatement
           changes.";
        uses change-info;
        container old {
          description
            "Changed statements in the older revision of the YANG
             module.";
          uses module-substmts;
        }
        container new {
          description
            "Changed statements in the newer revision of the YANG
             module.";
          uses module-substmts;
        }
      }
      uses local-info {
        when "locally-resolved";
      }
      uses node-info;
    }
  }
}
]]></sourcecode>
        <section anchor="yang_module_schema_cmp_out_tree">
            <name>Tree diagram</name>
            <t keepWithNext="true">
                The “ietf-yang-schema-comparison-output” YANG module has the
                following structure:
            </t>
            <figure>
                <artwork>
module: ietf-yang-schema-comparison-output

 structure schema-comparison:
   +-- comparison*
      +-- locally-resolved?           empty
      +-- fully-resolved?             empty
      +-- source
      |  +-- module?            yang:yang-identifier
      |  +-- revision?          revision-or-empty
      |  +-- version?           ysv:version
      |  +-- submodule* [name revision]
      |  |  +-- name        yang:yang-identifier
      |  |  +-- revision    revision-or-empty
      |  +-- enabled-feature*   yang:yang-identifier
      +-- source-import* [module revision]
      |  +-- module             yang:yang-identifier
      |  +-- revision           revision-or-empty
      |  +-- version?           ysv:version
      |  +-- submodule* [name revision]
      |  |  +-- name        yang:yang-identifier
      |  |  +-- revision    revision-or-empty
      |  +-- enabled-feature*   yang:yang-identifier
      +-- target
      |  +-- module?            yang:yang-identifier
      |  +-- revision?          revision-or-empty
      |  +-- version?           ysv:version
      |  +-- submodule* [name revision]
      |  |  +-- name        yang:yang-identifier
      |  |  +-- revision    revision-or-empty
      |  +-- enabled-feature*   yang:yang-identifier
      +-- target-import* [module revision]
      |  +-- module             yang:yang-identifier
      |  +-- revision           revision-or-empty
      |  +-- version?           ysv:version
      |  +-- submodule* [name revision]
      |  |  +-- name        yang:yang-identifier
      |  |  +-- revision    revision-or-empty
      |  +-- enabled-feature*   yang:yang-identifier
      +-- conformance                 enumeration
      +-- suggested-target-version    ysv:version
      +-- module-comparison*
      |  +-- changed* [stmt]
      |  |  +-- stmt           stmt-type
      |  |  +-- parent-stmt?   stmt-type
      |  |  +-- change         enumeration
      |  |  +-- conformance    enumeration
      |  +-- old
      |  |  +-- yang-version?   string
      |  |  +-- prefix?         string
      |  |  +-- import!
      |  |  |  +-- module           yang:yang-identifier
      |  |  |  +-- prefix           yang:yang-identifier
      |  |  |  +-- revision-date?   yanglib:revision-identifier
      |  |  |  +-- description?     string
      |  |  |  +-- reference?       string
      |  |  |  +-- ext-instance*
      |  |  |     +-- module           yang:yang-identifier
      |  |  |     +-- name             yang:yang-identifier
      |  |  |     +-- argument?        string
      |  |  |     +-- substatements?   anydata
      |  |  +-- include!
      |  |  |  +-- submodule        yang:yang-identifier
      |  |  |  +-- revision-date?   yanglib:revision-identifier
      |  |  |  +-- description?     string
      |  |  |  +-- reference?       string
      |  |  |  +-- ext-instance*
      |  |  |     +-- module           yang:yang-identifier
      |  |  |     +-- name             yang:yang-identifier
      |  |  |     +-- argument?        string
      |  |  |     +-- substatements?   anydata
      |  |  +-- organization?   string
      |  |  +-- contact?        string
      |  |  +-- description?    string
      |  |  +-- reference?      string
      |  |  +-- extension!
      |  |  |  +-- name            yang:yang-identifier
      |  |  |  +-- argument?       string
      |  |  |  +-- status          enumeration
      |  |  |  +-- description?    string
      |  |  |  +-- reference?      string
      |  |  |  +-- ext-instance*
      |  |  |     +-- module           yang:yang-identifier
      |  |  |     +-- name             yang:yang-identifier
      |  |  |     +-- argument?        string
      |  |  |     +-- substatements?   anydata
      |  |  +-- feature!
      |  |  |  +-- name            yang:yang-identifier
      |  |  |  +-- if-feature*     string
      |  |  |  +-- status          enumeration
      |  |  |  +-- description?    string
      |  |  |  +-- reference?      string
      |  |  |  +-- ext-instance*
      |  |  |     +-- module           yang:yang-identifier
      |  |  |     +-- name             yang:yang-identifier
      |  |  |     +-- argument?        string
      |  |  |     +-- substatements?   anydata
      |  |  +-- identity
      |  |  |  +-- name            yang:yang-identifier
      |  |  |  +-- if-feature*     string
      |  |  |  +-- base*           string
      |  |  |  +-- ext-instance*
      |  |  |     +-- module           yang:yang-identifier
      |  |  |     +-- name             yang:yang-identifier
      |  |  |     +-- argument?        string
      |  |  |     +-- substatements?   anydata
      |  |  +-- deviation!
      |  |  |  +-- target          string
      |  |  |  +-- deviate*
      |  |  |  |  +-- argument        enumeration
      |  |  |  |  +-- must*
      |  |  |  |  |  +-- condition?       string
      |  |  |  |  |  +-- description?     string
      |  |  |  |  |  +-- reference?       string
      |  |  |  |  |  +-- error-message?   string
      |  |  |  |  |  +-- error-app-tag?   string
      |  |  |  |  |  +-- ext-instance*
      |  |  |  |  |     +-- module           yang:yang-identifier
      |  |  |  |  |     +-- name             yang:yang-identifier
      |  |  |  |  |     +-- argument?        string
      |  |  |  |  |     +-- substatements?   anydata
      |  |  |  |  +-- default*        string
      |  |  |  |  +-- config?         boolean
      |  |  |  |  +-- mandatory?      boolean
      |  |  |  |  +-- min-elements?   uint32
      |  |  |  |  +-- max-elements?   uint32
      |  |  |  |  +-- type
      |  |  |  |  |  +-- name?               string
      |  |  |  |  |  +-- range
      |  |  |  |  |  |  +-- restriction?     string
      |  |  |  |  |  |  +-- description?     string
      |  |  |  |  |  |  +-- reference?       string
      |  |  |  |  |  |  +-- error-message?   string
      |  |  |  |  |  |  +-- error-app-tag?   string
      |  |  |  |  |  |  +-- ext-instance*
      |  |  |  |  |  |     +-- module           yang:yang-identifier
      |  |  |  |  |  |     +-- name             yang:yang-identifier
      |  |  |  |  |  |     +-- argument?        string
      |  |  |  |  |  |     +-- substatements?   anydata
      |  |  |  |  |  +-- length
      |  |  |  |  |  |  +-- restriction?     string
      |  |  |  |  |  |  +-- description?     string
      |  |  |  |  |  |  +-- reference?       string
      |  |  |  |  |  |  +-- error-message?   string
      |  |  |  |  |  |  +-- error-app-tag?   string
      |  |  |  |  |  |  +-- ext-instance*
      |  |  |  |  |  |     +-- module           yang:yang-identifier
      |  |  |  |  |  |     +-- name             yang:yang-identifier
      |  |  |  |  |  |     +-- argument?        string
      |  |  |  |  |  |     +-- substatements?   anydata
      |  |  |  |  |  +-- fraction-digits?    uint8
      |  |  |  |  |  +-- pattern*
      |  |  |  |  |  |  +-- expression?      string
      |  |  |  |  |  |  +-- inverted?        boolean
      |  |  |  |  |  |  +-- description?     string
      |  |  |  |  |  |  +-- reference?       string
      |  |  |  |  |  |  +-- error-message?   string
      |  |  |  |  |  |  +-- error-app-tag?   string
      |  |  |  |  |  |  +-- ext-instance*
      |  |  |  |  |  |     +-- module           yang:yang-identifier
      |  |  |  |  |  |     +-- name             yang:yang-identifier
      |  |  |  |  |  |     +-- argument?        string
      |  |  |  |  |  |     +-- substatements?   anydata
      |  |  |  |  |  +-- enum* [name]
      |  |  |  |  |  |  +-- name            yang:yang-identifier
      |  |  |  |  |  |  +-- if-feature*     string
      |  |  |  |  |  |  +-- description?    string
      |  |  |  |  |  |  +-- reference?      string
      |  |  |  |  |  |  +-- value?          int32
      |  |  |  |  |  |  +-- status          enumeration
      |  |  |  |  |  |  +-- ext-instance*
      |  |  |  |  |  |     +-- module           yang:yang-identifier
      |  |  |  |  |  |     +-- name             yang:yang-identifier
      |  |  |  |  |  |     +-- argument?        string
      |  |  |  |  |  |     +-- substatements?   anydata
      |  |  |  |  |  +-- bit* [name]
      |  |  |  |  |  |  +-- name            yang:yang-identifier
      |  |  |  |  |  |  +-- if-feature*     string
      |  |  |  |  |  |  +-- description?    string
      |  |  |  |  |  |  +-- reference?      string
      |  |  |  |  |  |  +-- position?       uint32
      |  |  |  |  |  |  +-- status          enumeration
      |  |  |  |  |  |  +-- ext-instance*
      |  |  |  |  |  |     +-- module           yang:yang-identifier
      |  |  |  |  |  |     +-- name             yang:yang-identifier
      |  |  |  |  |  |     +-- argument?        string
      |  |  |  |  |  |     +-- substatements?   anydata
      |  |  |  |  |  +-- path?               string
      |  |  |  |  |  +-- require-instance?   boolean
      |  |  |  |  |  +-- base*               string
      |  |  |  |  |  +-- ext-instance*
      |  |  |  |  |  |  +-- module           yang:yang-identifier
      |  |  |  |  |  |  +-- name             yang:yang-identifier
      |  |  |  |  |  |  +-- argument?        string
      |  |  |  |  |  |  +-- substatements?   anydata
      |  |  |  |  |  +-- union-type*
      |  |  |  |  |     +-- name?               string
      |  |  |  |  |     +-- range
      |  |  |  |  |     |  +-- restriction?     string
      |  |  |  |  |     |  +-- description?     string
      |  |  |  |  |     |  +-- reference?       string
      |  |  |  |  |     |  +-- error-message?   string
      |  |  |  |  |     |  +-- error-app-tag?   string
      |  |  |  |  |     |  +-- ext-instance*
      |  |  |  |  |     |     +-- module           yang:yang-identifier
      |  |  |  |  |     |     +-- name             yang:yang-identifier
      |  |  |  |  |     |     +-- argument?        string
      |  |  |  |  |     |     +-- substatements?   anydata
      |  |  |  |  |     +-- length
      |  |  |  |  |     |  +-- restriction?     string
      |  |  |  |  |     |  +-- description?     string
      |  |  |  |  |     |  +-- reference?       string
      |  |  |  |  |     |  +-- error-message?   string
      |  |  |  |  |     |  +-- error-app-tag?   string
      |  |  |  |  |     |  +-- ext-instance*
      |  |  |  |  |     |     +-- module           yang:yang-identifier
      |  |  |  |  |     |     +-- name             yang:yang-identifier
      |  |  |  |  |     |     +-- argument?        string
      |  |  |  |  |     |     +-- substatements?   anydata
      |  |  |  |  |     +-- fraction-digits?    uint8
      |  |  |  |  |     +-- pattern*
      |  |  |  |  |     |  +-- expression?      string
      |  |  |  |  |     |  +-- inverted?        boolean
      |  |  |  |  |     |  +-- description?     string
      |  |  |  |  |     |  +-- reference?       string
      |  |  |  |  |     |  +-- error-message?   string
      |  |  |  |  |     |  +-- error-app-tag?   string
      |  |  |  |  |     |  +-- ext-instance*
      |  |  |  |  |     |     +-- module           yang:yang-identifier
      |  |  |  |  |     |     +-- name             yang:yang-identifier
      |  |  |  |  |     |     +-- argument?        string
      |  |  |  |  |     |     +-- substatements?   anydata
      |  |  |  |  |     +-- enum* [name]
      |  |  |  |  |     |  +-- name            yang:yang-identifier
      |  |  |  |  |     |  +-- if-feature*     string
      |  |  |  |  |     |  +-- description?    string
      |  |  |  |  |     |  +-- reference?      string
      |  |  |  |  |     |  +-- value?          int32
      |  |  |  |  |     |  +-- status          enumeration
      |  |  |  |  |     |  +-- ext-instance*
      |  |  |  |  |     |     +-- module           yang:yang-identifier
      |  |  |  |  |     |     +-- name             yang:yang-identifier
      |  |  |  |  |     |     +-- argument?        string
      |  |  |  |  |     |     +-- substatements?   anydata
      |  |  |  |  |     +-- bit* [name]
      |  |  |  |  |     |  +-- name            yang:yang-identifier
      |  |  |  |  |     |  +-- if-feature*     string
      |  |  |  |  |     |  +-- description?    string
      |  |  |  |  |     |  +-- reference?      string
      |  |  |  |  |     |  +-- position?       uint32
      |  |  |  |  |     |  +-- status          enumeration
      |  |  |  |  |     |  +-- ext-instance*
      |  |  |  |  |     |     +-- module           yang:yang-identifier
      |  |  |  |  |     |     +-- name             yang:yang-identifier
      |  |  |  |  |     |     +-- argument?        string
      |  |  |  |  |     |     +-- substatements?   anydata
      |  |  |  |  |     +-- path?               string
      |  |  |  |  |     +-- require-instance?   boolean
      |  |  |  |  |     +-- base*               string
      |  |  |  |  |     +-- ext-instance*
      |  |  |  |  |        +-- module           yang:yang-identifier
      |  |  |  |  |        +-- name             yang:yang-identifier
      |  |  |  |  |        +-- argument?        string
      |  |  |  |  |        +-- substatements?   anydata
      |  |  |  |  +-- units?          string
      |  |  |  |  +-- unique*
      |  |  |  |     +-- node*   yang:yang-identifier
      |  |  |  +-- description?    string
      |  |  |  +-- reference?      string
      |  |  |  +-- ext-instance*
      |  |  |     +-- module           yang:yang-identifier
      |  |  |     +-- name             yang:yang-identifier
      |  |  |     +-- argument?        string
      |  |  |     +-- substatements?   anydata
      |  |  +-- ext-instance!
      |  |     +-- module           yang:yang-identifier
      |  |     +-- name             yang:yang-identifier
      |  |     +-- argument?        string
      |  |     +-- substatements?   anydata
      |  +-- new
      |     +-- yang-version?   string
      |     +-- prefix?         string
      |     +-- import!
      |     |  +-- module           yang:yang-identifier
      |     |  +-- prefix           yang:yang-identifier
      |     |  +-- revision-date?   yanglib:revision-identifier
      |     |  +-- description?     string
      |     |  +-- reference?       string
      |     |  +-- ext-instance*
      |     |     +-- module           yang:yang-identifier
      |     |     +-- name             yang:yang-identifier
      |     |     +-- argument?        string
      |     |     +-- substatements?   anydata
      |     +-- include!
      |     |  +-- submodule        yang:yang-identifier
      |     |  +-- revision-date?   yanglib:revision-identifier
      |     |  +-- description?     string
      |     |  +-- reference?       string
      |     |  +-- ext-instance*
      |     |     +-- module           yang:yang-identifier
      |     |     +-- name             yang:yang-identifier
      |     |     +-- argument?        string
      |     |     +-- substatements?   anydata
      |     +-- organization?   string
      |     +-- contact?        string
      |     +-- description?    string
      |     +-- reference?      string
      |     +-- extension!
      |     |  +-- name            yang:yang-identifier
      |     |  +-- argument?       string
      |     |  +-- status          enumeration
      |     |  +-- description?    string
      |     |  +-- reference?      string
      |     |  +-- ext-instance*
      |     |     +-- module           yang:yang-identifier
      |     |     +-- name             yang:yang-identifier
      |     |     +-- argument?        string
      |     |     +-- substatements?   anydata
      |     +-- feature!
      |     |  +-- name            yang:yang-identifier
      |     |  +-- if-feature*     string
      |     |  +-- status          enumeration
      |     |  +-- description?    string
      |     |  +-- reference?      string
      |     |  +-- ext-instance*
      |     |     +-- module           yang:yang-identifier
      |     |     +-- name             yang:yang-identifier
      |     |     +-- argument?        string
      |     |     +-- substatements?   anydata
      |     +-- identity
      |     |  +-- name            yang:yang-identifier
      |     |  +-- if-feature*     string
      |     |  +-- base*           string
      |     |  +-- ext-instance*
      |     |     +-- module           yang:yang-identifier
      |     |     +-- name             yang:yang-identifier
      |     |     +-- argument?        string
      |     |     +-- substatements?   anydata
      |     +-- deviation!
      |     |  +-- target          string
      |     |  +-- deviate*
      |     |  |  +-- argument        enumeration
      |     |  |  +-- must*
      |     |  |  |  +-- condition?       string
      |     |  |  |  +-- description?     string
      |     |  |  |  +-- reference?       string
      |     |  |  |  +-- error-message?   string
      |     |  |  |  +-- error-app-tag?   string
      |     |  |  |  +-- ext-instance*
      |     |  |  |     +-- module           yang:yang-identifier
      |     |  |  |     +-- name             yang:yang-identifier
      |     |  |  |     +-- argument?        string
      |     |  |  |     +-- substatements?   anydata
      |     |  |  +-- default*        string
      |     |  |  +-- config?         boolean
      |     |  |  +-- mandatory?      boolean
      |     |  |  +-- min-elements?   uint32
      |     |  |  +-- max-elements?   uint32
      |     |  |  +-- type
      |     |  |  |  +-- name?               string
      |     |  |  |  +-- range
      |     |  |  |  |  +-- restriction?     string
      |     |  |  |  |  +-- description?     string
      |     |  |  |  |  +-- reference?       string
      |     |  |  |  |  +-- error-message?   string
      |     |  |  |  |  +-- error-app-tag?   string
      |     |  |  |  |  +-- ext-instance*
      |     |  |  |  |     +-- module           yang:yang-identifier
      |     |  |  |  |     +-- name             yang:yang-identifier
      |     |  |  |  |     +-- argument?        string
      |     |  |  |  |     +-- substatements?   anydata
      |     |  |  |  +-- length
      |     |  |  |  |  +-- restriction?     string
      |     |  |  |  |  +-- description?     string
      |     |  |  |  |  +-- reference?       string
      |     |  |  |  |  +-- error-message?   string
      |     |  |  |  |  +-- error-app-tag?   string
      |     |  |  |  |  +-- ext-instance*
      |     |  |  |  |     +-- module           yang:yang-identifier
      |     |  |  |  |     +-- name             yang:yang-identifier
      |     |  |  |  |     +-- argument?        string
      |     |  |  |  |     +-- substatements?   anydata
      |     |  |  |  +-- fraction-digits?    uint8
      |     |  |  |  +-- pattern*
      |     |  |  |  |  +-- expression?      string
      |     |  |  |  |  +-- inverted?        boolean
      |     |  |  |  |  +-- description?     string
      |     |  |  |  |  +-- reference?       string
      |     |  |  |  |  +-- error-message?   string
      |     |  |  |  |  +-- error-app-tag?   string
      |     |  |  |  |  +-- ext-instance*
      |     |  |  |  |     +-- module           yang:yang-identifier
      |     |  |  |  |     +-- name             yang:yang-identifier
      |     |  |  |  |     +-- argument?        string
      |     |  |  |  |     +-- substatements?   anydata
      |     |  |  |  +-- enum* [name]
      |     |  |  |  |  +-- name            yang:yang-identifier
      |     |  |  |  |  +-- if-feature*     string
      |     |  |  |  |  +-- description?    string
      |     |  |  |  |  +-- reference?      string
      |     |  |  |  |  +-- value?          int32
      |     |  |  |  |  +-- status          enumeration
      |     |  |  |  |  +-- ext-instance*
      |     |  |  |  |     +-- module           yang:yang-identifier
      |     |  |  |  |     +-- name             yang:yang-identifier
      |     |  |  |  |     +-- argument?        string
      |     |  |  |  |     +-- substatements?   anydata
      |     |  |  |  +-- bit* [name]
      |     |  |  |  |  +-- name            yang:yang-identifier
      |     |  |  |  |  +-- if-feature*     string
      |     |  |  |  |  +-- description?    string
      |     |  |  |  |  +-- reference?      string
      |     |  |  |  |  +-- position?       uint32
      |     |  |  |  |  +-- status          enumeration
      |     |  |  |  |  +-- ext-instance*
      |     |  |  |  |     +-- module           yang:yang-identifier
      |     |  |  |  |     +-- name             yang:yang-identifier
      |     |  |  |  |     +-- argument?        string
      |     |  |  |  |     +-- substatements?   anydata
      |     |  |  |  +-- path?               string
      |     |  |  |  +-- require-instance?   boolean
      |     |  |  |  +-- base*               string
      |     |  |  |  +-- ext-instance*
      |     |  |  |  |  +-- module           yang:yang-identifier
      |     |  |  |  |  +-- name             yang:yang-identifier
      |     |  |  |  |  +-- argument?        string
      |     |  |  |  |  +-- substatements?   anydata
      |     |  |  |  +-- union-type*
      |     |  |  |     +-- name?               string
      |     |  |  |     +-- range
      |     |  |  |     |  +-- restriction?     string
      |     |  |  |     |  +-- description?     string
      |     |  |  |     |  +-- reference?       string
      |     |  |  |     |  +-- error-message?   string
      |     |  |  |     |  +-- error-app-tag?   string
      |     |  |  |     |  +-- ext-instance*
      |     |  |  |     |     +-- module           yang:yang-identifier
      |     |  |  |     |     +-- name             yang:yang-identifier
      |     |  |  |     |     +-- argument?        string
      |     |  |  |     |     +-- substatements?   anydata
      |     |  |  |     +-- length
      |     |  |  |     |  +-- restriction?     string
      |     |  |  |     |  +-- description?     string
      |     |  |  |     |  +-- reference?       string
      |     |  |  |     |  +-- error-message?   string
      |     |  |  |     |  +-- error-app-tag?   string
      |     |  |  |     |  +-- ext-instance*
      |     |  |  |     |     +-- module           yang:yang-identifier
      |     |  |  |     |     +-- name             yang:yang-identifier
      |     |  |  |     |     +-- argument?        string
      |     |  |  |     |     +-- substatements?   anydata
      |     |  |  |     +-- fraction-digits?    uint8
      |     |  |  |     +-- pattern*
      |     |  |  |     |  +-- expression?      string
      |     |  |  |     |  +-- inverted?        boolean
      |     |  |  |     |  +-- description?     string
      |     |  |  |     |  +-- reference?       string
      |     |  |  |     |  +-- error-message?   string
      |     |  |  |     |  +-- error-app-tag?   string
      |     |  |  |     |  +-- ext-instance*
      |     |  |  |     |     +-- module           yang:yang-identifier
      |     |  |  |     |     +-- name             yang:yang-identifier
      |     |  |  |     |     +-- argument?        string
      |     |  |  |     |     +-- substatements?   anydata
      |     |  |  |     +-- enum* [name]
      |     |  |  |     |  +-- name            yang:yang-identifier
      |     |  |  |     |  +-- if-feature*     string
      |     |  |  |     |  +-- description?    string
      |     |  |  |     |  +-- reference?      string
      |     |  |  |     |  +-- value?          int32
      |     |  |  |     |  +-- status          enumeration
      |     |  |  |     |  +-- ext-instance*
      |     |  |  |     |     +-- module           yang:yang-identifier
      |     |  |  |     |     +-- name             yang:yang-identifier
      |     |  |  |     |     +-- argument?        string
      |     |  |  |     |     +-- substatements?   anydata
      |     |  |  |     +-- bit* [name]
      |     |  |  |     |  +-- name            yang:yang-identifier
      |     |  |  |     |  +-- if-feature*     string
      |     |  |  |     |  +-- description?    string
      |     |  |  |     |  +-- reference?      string
      |     |  |  |     |  +-- position?       uint32
      |     |  |  |     |  +-- status          enumeration
      |     |  |  |     |  +-- ext-instance*
      |     |  |  |     |     +-- module           yang:yang-identifier
      |     |  |  |     |     +-- name             yang:yang-identifier
      |     |  |  |     |     +-- argument?        string
      |     |  |  |     |     +-- substatements?   anydata
      |     |  |  |     +-- path?               string
      |     |  |  |     +-- require-instance?   boolean
      |     |  |  |     +-- base*               string
      |     |  |  |     +-- ext-instance*
      |     |  |  |        +-- module           yang:yang-identifier
      |     |  |  |        +-- name             yang:yang-identifier
      |     |  |  |        +-- argument?        string
      |     |  |  |        +-- substatements?   anydata
      |     |  |  +-- units?          string
      |     |  |  +-- unique*
      |     |  |     +-- node*   yang:yang-identifier
      |     |  +-- description?    string
      |     |  +-- reference?      string
      |     |  +-- ext-instance*
      |     |     +-- module           yang:yang-identifier
      |     |     +-- name             yang:yang-identifier
      |     |     +-- argument?        string
      |     |     +-- substatements?   anydata
      |     +-- ext-instance!
      |        +-- module           yang:yang-identifier
      |        +-- name             yang:yang-identifier
      |        +-- argument?        string
      |        +-- substatements?   anydata
      +-- local-comparison*
      |  +-- parent-path?   schema-stmt-path
      |  +-- identifier     string
      |  +-- stmt-type      enumeration
      |  +-- changed* [stmt]
      |  |  +-- stmt           stmt-type
      |  |  +-- parent-stmt?   stmt-type
      |  |  +-- change         enumeration
      |  |  +-- conformance    enumeration
      |  +-- old
      |  |  +-- if-feature*     string
      |  |  +-- when*
      |  |  |  +-- condition?      string
      |  |  |  +-- description?    string
      |  |  |  +-- reference?      string
      |  |  |  +-- status          enumeration
      |  |  |  +-- ext-instance*
      |  |  |     +-- module           yang:yang-identifier
      |  |  |     +-- name             yang:yang-identifier
      |  |  |     +-- argument?        string
      |  |  |     +-- substatements?   anydata
      |  |  +-- description?    string
      |  |  +-- reference?      string
      |  |  +-- status          enumeration
      |  |  +-- must*
      |  |  |  +-- condition?       string
      |  |  |  +-- description?     string
      |  |  |  +-- reference?       string
      |  |  |  +-- error-message?   string
      |  |  |  +-- error-app-tag?   string
      |  |  |  +-- ext-instance*
      |  |  |     +-- module           yang:yang-identifier
      |  |  |     +-- name             yang:yang-identifier
      |  |  |     +-- argument?        string
      |  |  |     +-- substatements?   anydata
      |  |  +-- default*        string
      |  |  +-- config?         boolean
      |  |  +-- mandatory?      boolean
      |  |  +-- min-elements?   uint32
      |  |  +-- max-elements?   uint32
      |  |  +-- type
      |  |  |  +-- name?               string
      |  |  |  +-- range
      |  |  |  |  +-- restriction?     string
      |  |  |  |  +-- description?     string
      |  |  |  |  +-- reference?       string
      |  |  |  |  +-- error-message?   string
      |  |  |  |  +-- error-app-tag?   string
      |  |  |  |  +-- ext-instance*
      |  |  |  |     +-- module           yang:yang-identifier
      |  |  |  |     +-- name             yang:yang-identifier
      |  |  |  |     +-- argument?        string
      |  |  |  |     +-- substatements?   anydata
      |  |  |  +-- length
      |  |  |  |  +-- restriction?     string
      |  |  |  |  +-- description?     string
      |  |  |  |  +-- reference?       string
      |  |  |  |  +-- error-message?   string
      |  |  |  |  +-- error-app-tag?   string
      |  |  |  |  +-- ext-instance*
      |  |  |  |     +-- module           yang:yang-identifier
      |  |  |  |     +-- name             yang:yang-identifier
      |  |  |  |     +-- argument?        string
      |  |  |  |     +-- substatements?   anydata
      |  |  |  +-- fraction-digits?    uint8
      |  |  |  +-- pattern*
      |  |  |  |  +-- expression?      string
      |  |  |  |  +-- inverted?        boolean
      |  |  |  |  +-- description?     string
      |  |  |  |  +-- reference?       string
      |  |  |  |  +-- error-message?   string
      |  |  |  |  +-- error-app-tag?   string
      |  |  |  |  +-- ext-instance*
      |  |  |  |     +-- module           yang:yang-identifier
      |  |  |  |     +-- name             yang:yang-identifier
      |  |  |  |     +-- argument?        string
      |  |  |  |     +-- substatements?   anydata
      |  |  |  +-- enum* [name]
      |  |  |  |  +-- name            yang:yang-identifier
      |  |  |  |  +-- if-feature*     string
      |  |  |  |  +-- description?    string
      |  |  |  |  +-- reference?      string
      |  |  |  |  +-- value?          int32
      |  |  |  |  +-- status          enumeration
      |  |  |  |  +-- ext-instance*
      |  |  |  |     +-- module           yang:yang-identifier
      |  |  |  |     +-- name             yang:yang-identifier
      |  |  |  |     +-- argument?        string
      |  |  |  |     +-- substatements?   anydata
      |  |  |  +-- bit* [name]
      |  |  |  |  +-- name            yang:yang-identifier
      |  |  |  |  +-- if-feature*     string
      |  |  |  |  +-- description?    string
      |  |  |  |  +-- reference?      string
      |  |  |  |  +-- position?       uint32
      |  |  |  |  +-- status          enumeration
      |  |  |  |  +-- ext-instance*
      |  |  |  |     +-- module           yang:yang-identifier
      |  |  |  |     +-- name             yang:yang-identifier
      |  |  |  |     +-- argument?        string
      |  |  |  |     +-- substatements?   anydata
      |  |  |  +-- path?               string
      |  |  |  +-- require-instance?   boolean
      |  |  |  +-- base*               string
      |  |  |  +-- ext-instance*
      |  |  |  |  +-- module           yang:yang-identifier
      |  |  |  |  +-- name             yang:yang-identifier
      |  |  |  |  +-- argument?        string
      |  |  |  |  +-- substatements?   anydata
      |  |  |  +-- union-type*
      |  |  |     +-- name?               string
      |  |  |     +-- range
      |  |  |     |  +-- restriction?     string
      |  |  |     |  +-- description?     string
      |  |  |     |  +-- reference?       string
      |  |  |     |  +-- error-message?   string
      |  |  |     |  +-- error-app-tag?   string
      |  |  |     |  +-- ext-instance*
      |  |  |     |     +-- module           yang:yang-identifier
      |  |  |     |     +-- name             yang:yang-identifier
      |  |  |     |     +-- argument?        string
      |  |  |     |     +-- substatements?   anydata
      |  |  |     +-- length
      |  |  |     |  +-- restriction?     string
      |  |  |     |  +-- description?     string
      |  |  |     |  +-- reference?       string
      |  |  |     |  +-- error-message?   string
      |  |  |     |  +-- error-app-tag?   string
      |  |  |     |  +-- ext-instance*
      |  |  |     |     +-- module           yang:yang-identifier
      |  |  |     |     +-- name             yang:yang-identifier
      |  |  |     |     +-- argument?        string
      |  |  |     |     +-- substatements?   anydata
      |  |  |     +-- fraction-digits?    uint8
      |  |  |     +-- pattern*
      |  |  |     |  +-- expression?      string
      |  |  |     |  +-- inverted?        boolean
      |  |  |     |  +-- description?     string
      |  |  |     |  +-- reference?       string
      |  |  |     |  +-- error-message?   string
      |  |  |     |  +-- error-app-tag?   string
      |  |  |     |  +-- ext-instance*
      |  |  |     |     +-- module           yang:yang-identifier
      |  |  |     |     +-- name             yang:yang-identifier
      |  |  |     |     +-- argument?        string
      |  |  |     |     +-- substatements?   anydata
      |  |  |     +-- enum* [name]
      |  |  |     |  +-- name            yang:yang-identifier
      |  |  |     |  +-- if-feature*     string
      |  |  |     |  +-- description?    string
      |  |  |     |  +-- reference?      string
      |  |  |     |  +-- value?          int32
      |  |  |     |  +-- status          enumeration
      |  |  |     |  +-- ext-instance*
      |  |  |     |     +-- module           yang:yang-identifier
      |  |  |     |     +-- name             yang:yang-identifier
      |  |  |     |     +-- argument?        string
      |  |  |     |     +-- substatements?   anydata
      |  |  |     +-- bit* [name]
      |  |  |     |  +-- name            yang:yang-identifier
      |  |  |     |  +-- if-feature*     string
      |  |  |     |  +-- description?    string
      |  |  |     |  +-- reference?      string
      |  |  |     |  +-- position?       uint32
      |  |  |     |  +-- status          enumeration
      |  |  |     |  +-- ext-instance*
      |  |  |     |     +-- module           yang:yang-identifier
      |  |  |     |     +-- name             yang:yang-identifier
      |  |  |     |     +-- argument?        string
      |  |  |     |     +-- substatements?   anydata
      |  |  |     +-- path?               string
      |  |  |     +-- require-instance?   boolean
      |  |  |     +-- base*               string
      |  |  |     +-- ext-instance*
      |  |  |        +-- module           yang:yang-identifier
      |  |  |        +-- name             yang:yang-identifier
      |  |  |        +-- argument?        string
      |  |  |        +-- substatements?   anydata
      |  |  +-- units?          string
      |  |  +-- key?            string
      |  |  +-- unique*         string
      |  |  +-- presence?       string
      |  |  +-- ext-instance*
      |  |     +-- module           yang:yang-identifier
      |  |     +-- name             yang:yang-identifier
      |  |     +-- argument?        string
      |  |     +-- substatements?   anydata
      |  +-- new
      |     +-- if-feature*     string
      |     +-- when*
      |     |  +-- condition?      string
      |     |  +-- description?    string
      |     |  +-- reference?      string
      |     |  +-- status          enumeration
      |     |  +-- ext-instance*
      |     |     +-- module           yang:yang-identifier
      |     |     +-- name             yang:yang-identifier
      |     |     +-- argument?        string
      |     |     +-- substatements?   anydata
      |     +-- description?    string
      |     +-- reference?      string
      |     +-- status          enumeration
      |     +-- must*
      |     |  +-- condition?       string
      |     |  +-- description?     string
      |     |  +-- reference?       string
      |     |  +-- error-message?   string
      |     |  +-- error-app-tag?   string
      |     |  +-- ext-instance*
      |     |     +-- module           yang:yang-identifier
      |     |     +-- name             yang:yang-identifier
      |     |     +-- argument?        string
      |     |     +-- substatements?   anydata
      |     +-- default*        string
      |     +-- config?         boolean
      |     +-- mandatory?      boolean
      |     +-- min-elements?   uint32
      |     +-- max-elements?   uint32
      |     +-- type
      |     |  +-- name?               string
      |     |  +-- range
      |     |  |  +-- restriction?     string
      |     |  |  +-- description?     string
      |     |  |  +-- reference?       string
      |     |  |  +-- error-message?   string
      |     |  |  +-- error-app-tag?   string
      |     |  |  +-- ext-instance*
      |     |  |     +-- module           yang:yang-identifier
      |     |  |     +-- name             yang:yang-identifier
      |     |  |     +-- argument?        string
      |     |  |     +-- substatements?   anydata
      |     |  +-- length
      |     |  |  +-- restriction?     string
      |     |  |  +-- description?     string
      |     |  |  +-- reference?       string
      |     |  |  +-- error-message?   string
      |     |  |  +-- error-app-tag?   string
      |     |  |  +-- ext-instance*
      |     |  |     +-- module           yang:yang-identifier
      |     |  |     +-- name             yang:yang-identifier
      |     |  |     +-- argument?        string
      |     |  |     +-- substatements?   anydata
      |     |  +-- fraction-digits?    uint8
      |     |  +-- pattern*
      |     |  |  +-- expression?      string
      |     |  |  +-- inverted?        boolean
      |     |  |  +-- description?     string
      |     |  |  +-- reference?       string
      |     |  |  +-- error-message?   string
      |     |  |  +-- error-app-tag?   string
      |     |  |  +-- ext-instance*
      |     |  |     +-- module           yang:yang-identifier
      |     |  |     +-- name             yang:yang-identifier
      |     |  |     +-- argument?        string
      |     |  |     +-- substatements?   anydata
      |     |  +-- enum* [name]
      |     |  |  +-- name            yang:yang-identifier
      |     |  |  +-- if-feature*     string
      |     |  |  +-- description?    string
      |     |  |  +-- reference?      string
      |     |  |  +-- value?          int32
      |     |  |  +-- status          enumeration
      |     |  |  +-- ext-instance*
      |     |  |     +-- module           yang:yang-identifier
      |     |  |     +-- name             yang:yang-identifier
      |     |  |     +-- argument?        string
      |     |  |     +-- substatements?   anydata
      |     |  +-- bit* [name]
      |     |  |  +-- name            yang:yang-identifier
      |     |  |  +-- if-feature*     string
      |     |  |  +-- description?    string
      |     |  |  +-- reference?      string
      |     |  |  +-- position?       uint32
      |     |  |  +-- status          enumeration
      |     |  |  +-- ext-instance*
      |     |  |     +-- module           yang:yang-identifier
      |     |  |     +-- name             yang:yang-identifier
      |     |  |     +-- argument?        string
      |     |  |     +-- substatements?   anydata
      |     |  +-- path?               string
      |     |  +-- require-instance?   boolean
      |     |  +-- base*               string
      |     |  +-- ext-instance*
      |     |  |  +-- module           yang:yang-identifier
      |     |  |  +-- name             yang:yang-identifier
      |     |  |  +-- argument?        string
      |     |  |  +-- substatements?   anydata
      |     |  +-- union-type*
      |     |     +-- name?               string
      |     |     +-- range
      |     |     |  +-- restriction?     string
      |     |     |  +-- description?     string
      |     |     |  +-- reference?       string
      |     |     |  +-- error-message?   string
      |     |     |  +-- error-app-tag?   string
      |     |     |  +-- ext-instance*
      |     |     |     +-- module           yang:yang-identifier
      |     |     |     +-- name             yang:yang-identifier
      |     |     |     +-- argument?        string
      |     |     |     +-- substatements?   anydata
      |     |     +-- length
      |     |     |  +-- restriction?     string
      |     |     |  +-- description?     string
      |     |     |  +-- reference?       string
      |     |     |  +-- error-message?   string
      |     |     |  +-- error-app-tag?   string
      |     |     |  +-- ext-instance*
      |     |     |     +-- module           yang:yang-identifier
      |     |     |     +-- name             yang:yang-identifier
      |     |     |     +-- argument?        string
      |     |     |     +-- substatements?   anydata
      |     |     +-- fraction-digits?    uint8
      |     |     +-- pattern*
      |     |     |  +-- expression?      string
      |     |     |  +-- inverted?        boolean
      |     |     |  +-- description?     string
      |     |     |  +-- reference?       string
      |     |     |  +-- error-message?   string
      |     |     |  +-- error-app-tag?   string
      |     |     |  +-- ext-instance*
      |     |     |     +-- module           yang:yang-identifier
      |     |     |     +-- name             yang:yang-identifier
      |     |     |     +-- argument?        string
      |     |     |     +-- substatements?   anydata
      |     |     +-- enum* [name]
      |     |     |  +-- name            yang:yang-identifier
      |     |     |  +-- if-feature*     string
      |     |     |  +-- description?    string
      |     |     |  +-- reference?      string
      |     |     |  +-- value?          int32
      |     |     |  +-- status          enumeration
      |     |     |  +-- ext-instance*
      |     |     |     +-- module           yang:yang-identifier
      |     |     |     +-- name             yang:yang-identifier
      |     |     |     +-- argument?        string
      |     |     |     +-- substatements?   anydata
      |     |     +-- bit* [name]
      |     |     |  +-- name            yang:yang-identifier
      |     |     |  +-- if-feature*     string
      |     |     |  +-- description?    string
      |     |     |  +-- reference?      string
      |     |     |  +-- position?       uint32
      |     |     |  +-- status          enumeration
      |     |     |  +-- ext-instance*
      |     |     |     +-- module           yang:yang-identifier
      |     |     |     +-- name             yang:yang-identifier
      |     |     |     +-- argument?        string
      |     |     |     +-- substatements?   anydata
      |     |     +-- path?               string
      |     |     +-- require-instance?   boolean
      |     |     +-- base*               string
      |     |     +-- ext-instance*
      |     |        +-- module           yang:yang-identifier
      |     |        +-- name             yang:yang-identifier
      |     |        +-- argument?        string
      |     |        +-- substatements?   anydata
      |     +-- units?          string
      |     +-- key?            string
      |     +-- unique*         string
      |     +-- presence?       string
      |     +-- ext-instance*
      |        +-- module           yang:yang-identifier
      |        +-- name             yang:yang-identifier
      |        +-- argument?        string
      |        +-- substatements?   anydata
      +-- node-comparison* [node]
         +-- node         schema-node-path
         +-- node-type    enumeration
         +-- changed* [stmt]
         |  +-- stmt           stmt-type
         |  +-- parent-stmt?   stmt-type
         |  +-- change         enumeration
         |  +-- conformance    enumeration
         +-- old
         |  +-- if-feature*     string
         |  +-- when*
         |  |  +-- condition?      string
         |  |  +-- description?    string
         |  |  +-- reference?      string
         |  |  +-- status          enumeration
         |  |  +-- ext-instance*
         |  |     +-- module           yang:yang-identifier
         |  |     +-- name             yang:yang-identifier
         |  |     +-- argument?        string
         |  |     +-- substatements?   anydata
         |  +-- description?    string
         |  +-- reference?      string
         |  +-- status          enumeration
         |  +-- must*
         |  |  +-- condition?       string
         |  |  +-- description?     string
         |  |  +-- reference?       string
         |  |  +-- error-message?   string
         |  |  +-- error-app-tag?   string
         |  |  +-- ext-instance*
         |  |     +-- module           yang:yang-identifier
         |  |     +-- name             yang:yang-identifier
         |  |     +-- argument?        string
         |  |     +-- substatements?   anydata
         |  +-- default*        string
         |  +-- config?         boolean
         |  +-- mandatory?      boolean
         |  +-- min-elements?   uint32
         |  +-- max-elements?   uint32
         |  +-- key*            yang:yang-identifier
         |  +-- ordered-by?     enumeration
         |  +-- type
         |  |  +-- name?               string
         |  |  +-- range
         |  |  |  +-- restriction?     string
         |  |  |  +-- description?     string
         |  |  |  +-- reference?       string
         |  |  |  +-- error-message?   string
         |  |  |  +-- error-app-tag?   string
         |  |  |  +-- ext-instance*
         |  |  |     +-- module           yang:yang-identifier
         |  |  |     +-- name             yang:yang-identifier
         |  |  |     +-- argument?        string
         |  |  |     +-- substatements?   anydata
         |  |  +-- length
         |  |  |  +-- restriction?     string
         |  |  |  +-- description?     string
         |  |  |  +-- reference?       string
         |  |  |  +-- error-message?   string
         |  |  |  +-- error-app-tag?   string
         |  |  |  +-- ext-instance*
         |  |  |     +-- module           yang:yang-identifier
         |  |  |     +-- name             yang:yang-identifier
         |  |  |     +-- argument?        string
         |  |  |     +-- substatements?   anydata
         |  |  +-- fraction-digits?    uint8
         |  |  +-- pattern*
         |  |  |  +-- expression?      string
         |  |  |  +-- inverted?        boolean
         |  |  |  +-- description?     string
         |  |  |  +-- reference?       string
         |  |  |  +-- error-message?   string
         |  |  |  +-- error-app-tag?   string
         |  |  |  +-- ext-instance*
         |  |  |     +-- module           yang:yang-identifier
         |  |  |     +-- name             yang:yang-identifier
         |  |  |     +-- argument?        string
         |  |  |     +-- substatements?   anydata
         |  |  +-- enum* [name]
         |  |  |  +-- name            yang:yang-identifier
         |  |  |  +-- if-feature*     string
         |  |  |  +-- description?    string
         |  |  |  +-- reference?      string
         |  |  |  +-- value?          int32
         |  |  |  +-- status          enumeration
         |  |  |  +-- ext-instance*
         |  |  |     +-- module           yang:yang-identifier
         |  |  |     +-- name             yang:yang-identifier
         |  |  |     +-- argument?        string
         |  |  |     +-- substatements?   anydata
         |  |  +-- bit* [name]
         |  |  |  +-- name            yang:yang-identifier
         |  |  |  +-- if-feature*     string
         |  |  |  +-- description?    string
         |  |  |  +-- reference?      string
         |  |  |  +-- position?       uint32
         |  |  |  +-- status          enumeration
         |  |  |  +-- ext-instance*
         |  |  |     +-- module           yang:yang-identifier
         |  |  |     +-- name             yang:yang-identifier
         |  |  |     +-- argument?        string
         |  |  |     +-- substatements?   anydata
         |  |  +-- path?               string
         |  |  +-- require-instance?   boolean
         |  |  +-- base*               string
         |  |  +-- ext-instance*
         |  |  |  +-- module           yang:yang-identifier
         |  |  |  +-- name             yang:yang-identifier
         |  |  |  +-- argument?        string
         |  |  |  +-- substatements?   anydata
         |  |  +-- union-type*
         |  |     +-- name?               string
         |  |     +-- range
         |  |     |  +-- restriction?     string
         |  |     |  +-- description?     string
         |  |     |  +-- reference?       string
         |  |     |  +-- error-message?   string
         |  |     |  +-- error-app-tag?   string
         |  |     |  +-- ext-instance*
         |  |     |     +-- module           yang:yang-identifier
         |  |     |     +-- name             yang:yang-identifier
         |  |     |     +-- argument?        string
         |  |     |     +-- substatements?   anydata
         |  |     +-- length
         |  |     |  +-- restriction?     string
         |  |     |  +-- description?     string
         |  |     |  +-- reference?       string
         |  |     |  +-- error-message?   string
         |  |     |  +-- error-app-tag?   string
         |  |     |  +-- ext-instance*
         |  |     |     +-- module           yang:yang-identifier
         |  |     |     +-- name             yang:yang-identifier
         |  |     |     +-- argument?        string
         |  |     |     +-- substatements?   anydata
         |  |     +-- fraction-digits?    uint8
         |  |     +-- pattern*
         |  |     |  +-- expression?      string
         |  |     |  +-- inverted?        boolean
         |  |     |  +-- description?     string
         |  |     |  +-- reference?       string
         |  |     |  +-- error-message?   string
         |  |     |  +-- error-app-tag?   string
         |  |     |  +-- ext-instance*
         |  |     |     +-- module           yang:yang-identifier
         |  |     |     +-- name             yang:yang-identifier
         |  |     |     +-- argument?        string
         |  |     |     +-- substatements?   anydata
         |  |     +-- enum* [name]
         |  |     |  +-- name            yang:yang-identifier
         |  |     |  +-- if-feature*     string
         |  |     |  +-- description?    string
         |  |     |  +-- reference?      string
         |  |     |  +-- value?          int32
         |  |     |  +-- status          enumeration
         |  |     |  +-- ext-instance*
         |  |     |     +-- module           yang:yang-identifier
         |  |     |     +-- name             yang:yang-identifier
         |  |     |     +-- argument?        string
         |  |     |     +-- substatements?   anydata
         |  |     +-- bit* [name]
         |  |     |  +-- name            yang:yang-identifier
         |  |     |  +-- if-feature*     string
         |  |     |  +-- description?    string
         |  |     |  +-- reference?      string
         |  |     |  +-- position?       uint32
         |  |     |  +-- status          enumeration
         |  |     |  +-- ext-instance*
         |  |     |     +-- module           yang:yang-identifier
         |  |     |     +-- name             yang:yang-identifier
         |  |     |     +-- argument?        string
         |  |     |     +-- substatements?   anydata
         |  |     +-- path?               string
         |  |     +-- require-instance?   boolean
         |  |     +-- base*               string
         |  |     +-- ext-instance*
         |  |        +-- module           yang:yang-identifier
         |  |        +-- name             yang:yang-identifier
         |  |        +-- argument?        string
         |  |        +-- substatements?   anydata
         |  +-- units?          string
         |  +-- unique*
         |  |  +-- node*   yang:yang-identifier
         |  +-- presence?       string
         |  +-- ext-instance*
         |     +-- module           yang:yang-identifier
         |     +-- name             yang:yang-identifier
         |     +-- argument?        string
         |     +-- substatements?   anydata
         +-- new
            +-- if-feature*     string
            +-- when*
            |  +-- condition?      string
            |  +-- description?    string
            |  +-- reference?      string
            |  +-- status          enumeration
            |  +-- ext-instance*
            |     +-- module           yang:yang-identifier
            |     +-- name             yang:yang-identifier
            |     +-- argument?        string
            |     +-- substatements?   anydata
            +-- description?    string
            +-- reference?      string
            +-- status          enumeration
            +-- must*
            |  +-- condition?       string
            |  +-- description?     string
            |  +-- reference?       string
            |  +-- error-message?   string
            |  +-- error-app-tag?   string
            |  +-- ext-instance*
            |     +-- module           yang:yang-identifier
            |     +-- name             yang:yang-identifier
            |     +-- argument?        string
            |     +-- substatements?   anydata
            +-- default*        string
            +-- config?         boolean
            +-- mandatory?      boolean
            +-- min-elements?   uint32
            +-- max-elements?   uint32
            +-- key*            yang:yang-identifier
            +-- ordered-by?     enumeration
            +-- type
            |  +-- name?               string
            |  +-- range
            |  |  +-- restriction?     string
            |  |  +-- description?     string
            |  |  +-- reference?       string
            |  |  +-- error-message?   string
            |  |  +-- error-app-tag?   string
            |  |  +-- ext-instance*
            |  |     +-- module           yang:yang-identifier
            |  |     +-- name             yang:yang-identifier
            |  |     +-- argument?        string
            |  |     +-- substatements?   anydata
            |  +-- length
            |  |  +-- restriction?     string
            |  |  +-- description?     string
            |  |  +-- reference?       string
            |  |  +-- error-message?   string
            |  |  +-- error-app-tag?   string
            |  |  +-- ext-instance*
            |  |     +-- module           yang:yang-identifier
            |  |     +-- name             yang:yang-identifier
            |  |     +-- argument?        string
            |  |     +-- substatements?   anydata
            |  +-- fraction-digits?    uint8
            |  +-- pattern*
            |  |  +-- expression?      string
            |  |  +-- inverted?        boolean
            |  |  +-- description?     string
            |  |  +-- reference?       string
            |  |  +-- error-message?   string
            |  |  +-- error-app-tag?   string
            |  |  +-- ext-instance*
            |  |     +-- module           yang:yang-identifier
            |  |     +-- name             yang:yang-identifier
            |  |     +-- argument?        string
            |  |     +-- substatements?   anydata
            |  +-- enum* [name]
            |  |  +-- name            yang:yang-identifier
            |  |  +-- if-feature*     string
            |  |  +-- description?    string
            |  |  +-- reference?      string
            |  |  +-- value?          int32
            |  |  +-- status          enumeration
            |  |  +-- ext-instance*
            |  |     +-- module           yang:yang-identifier
            |  |     +-- name             yang:yang-identifier
            |  |     +-- argument?        string
            |  |     +-- substatements?   anydata
            |  +-- bit* [name]
            |  |  +-- name            yang:yang-identifier
            |  |  +-- if-feature*     string
            |  |  +-- description?    string
            |  |  +-- reference?      string
            |  |  +-- position?       uint32
            |  |  +-- status          enumeration
            |  |  +-- ext-instance*
            |  |     +-- module           yang:yang-identifier
            |  |     +-- name             yang:yang-identifier
            |  |     +-- argument?        string
            |  |     +-- substatements?   anydata
            |  +-- path?               string
            |  +-- require-instance?   boolean
            |  +-- base*               string
            |  +-- ext-instance*
            |  |  +-- module           yang:yang-identifier
            |  |  +-- name             yang:yang-identifier
            |  |  +-- argument?        string
            |  |  +-- substatements?   anydata
            |  +-- union-type*
            |     +-- name?               string
            |     +-- range
            |     |  +-- restriction?     string
            |     |  +-- description?     string
            |     |  +-- reference?       string
            |     |  +-- error-message?   string
            |     |  +-- error-app-tag?   string
            |     |  +-- ext-instance*
            |     |     +-- module           yang:yang-identifier
            |     |     +-- name             yang:yang-identifier
            |     |     +-- argument?        string
            |     |     +-- substatements?   anydata
            |     +-- length
            |     |  +-- restriction?     string
            |     |  +-- description?     string
            |     |  +-- reference?       string
            |     |  +-- error-message?   string
            |     |  +-- error-app-tag?   string
            |     |  +-- ext-instance*
            |     |     +-- module           yang:yang-identifier
            |     |     +-- name             yang:yang-identifier
            |     |     +-- argument?        string
            |     |     +-- substatements?   anydata
            |     +-- fraction-digits?    uint8
            |     +-- pattern*
            |     |  +-- expression?      string
            |     |  +-- inverted?        boolean
            |     |  +-- description?     string
            |     |  +-- reference?       string
            |     |  +-- error-message?   string
            |     |  +-- error-app-tag?   string
            |     |  +-- ext-instance*
            |     |     +-- module           yang:yang-identifier
            |     |     +-- name             yang:yang-identifier
            |     |     +-- argument?        string
            |     |     +-- substatements?   anydata
            |     +-- enum* [name]
            |     |  +-- name            yang:yang-identifier
            |     |  +-- if-feature*     string
            |     |  +-- description?    string
            |     |  +-- reference?      string
            |     |  +-- value?          int32
            |     |  +-- status          enumeration
            |     |  +-- ext-instance*
            |     |     +-- module           yang:yang-identifier
            |     |     +-- name             yang:yang-identifier
            |     |     +-- argument?        string
            |     |     +-- substatements?   anydata
            |     +-- bit* [name]
            |     |  +-- name            yang:yang-identifier
            |     |  +-- if-feature*     string
            |     |  +-- description?    string
            |     |  +-- reference?      string
            |     |  +-- position?       uint32
            |     |  +-- status          enumeration
            |     |  +-- ext-instance*
            |     |     +-- module           yang:yang-identifier
            |     |     +-- name             yang:yang-identifier
            |     |     +-- argument?        string
            |     |     +-- substatements?   anydata
            |     +-- path?               string
            |     +-- require-instance?   boolean
            |     +-- base*               string
            |     +-- ext-instance*
            |        +-- module           yang:yang-identifier
            |        +-- name             yang:yang-identifier
            |        +-- argument?        string
            |        +-- substatements?   anydata
            +-- units?          string
            +-- unique*
            |  +-- node*   yang:yang-identifier
            +-- presence?       string
            +-- ext-instance*
               +-- module           yang:yang-identifier
               +-- name             yang:yang-identifier
               +-- argument?        string
               +-- substatements?   anydata
                </artwork>
            </figure>
        </section>
    </section>
    <section anchor="change_conformance_principles">
        <name>Change Conformance Principles</name>
        <t>
            This appendix clarifies the general principles based on which
            statement changes are categorized. They are not meant to replace
            any specification but rather help with understanding it.
        </t>
        <section anchor="editorial_change">
            <name>Editorial change</name>
            <t>
                An editorial change does not affect valid YANG data of the
                semantics of the YANG module in any way. That is, it does not
                make the valid data value space smaller or larger and it must
                remain exactly the same as in the module revision without the
                change. Also, for a change to be editorial, it must not affect
                any YANG module importing the changed YANG module.
            </t>
            <t>
                In addition to obvious editorial changes such as fixing a typo
                in a "description", changing the local "prefix" of the module
                is also categorized as editorial because it does not affect
                importing modules. Or, replacing a "uses" statement directly
                with the nodes in the referenced "grouping" without any other
                changes.
            </t>
        </section>
        <section anchor="bc_change">
            <name>Backwards-compatible change</name>
            <t>
                For a change to be backwards-compatible, it has to expand the
                value space of valid YANG data. That is, all the valid YANG
                data nodes and values before the change must remain valid but
                additional nodes or values can also become valid after the
                change. Also, backwards-compatible changes may influence
                importing modules but must not cause them to become invalid. In
                other words, they may expose new statements whose removal would
                then be considered a non-backwards-compatible change but
                generally must not change the already exposed statements.
            </t>
            <t>
                For some examples, the majority of possible
                backwards-compatible changes are specifically mentioned
                directly in Section 11 of <xref target="RFC7950"/>.
            </t>
        </section>
        <section anchor="nbc_change">
            <name>Non-backwards-compatible change</name>
            <t>
                If a change is not editorial nor backwards-compatible, it is
                then categorized as non-backwards-compatible. Such changes
                shrink the value space of valid YANG data, causing some
                previously valid nodes or values to no longer be valid. Also,
                any change that may cause an importing module to become invalid
                according to the YANG specification must be non-backwards-compatible.
            </t>
            <t>
                Examples of less common or less obvious compatibility-breaking
                changes are changing the "yang-version" of a YANG module or
                expanding the size of a "type". The former change may break
                importing modules because of specific rules defined for the
                "import" statement and the target module's YANG version.
                Changing a "type" of a leaf from "uint32" to "uint64" may seem
                to fit the definition of a backwards-compatible change, but it
                may not be so for some data encodings that use a fixed binary
                data chunk (which would grow in size) or even a text format
                that may use a different encoding for the two types.
                Specifically, the JSON YANG data format
                <xref target="RFC7951"/> encodes a "uint32" value as a JSON
                number but a "uint64" as a JSON string.
            </t>
        </section>
    </section>
    <section anchor="examples">
        <name>Comparison Examples</name>
        <t>
            This section provides several examples of the output from the
            comparison algorithm defined in this document to illustrate its
            behavior on actual YANG modules. The example YANG modules are
            missing “description” or “reference” statements for better
            readability. Changes are represented as JSON encoded
            <xref target="RFC7951"/> YANG instance data following the
            “ietf-yang-schema-comparison-output” module definition in
            <xref target="yang_module_schema_cmp_out"/> for the output.
        </t>
        <section anchor="new_leaves_module" title="New Leaves Module">
            <t>
                In this example, two new leaves are added to the module.
            </t>
            <t>
                In the generated output, there are changes in both locally
                resolved module and fully resolved schema. The changes are
                backward-compatible because the new nodes are added without
                affecting the order of the existing schema nodes.
            </t>
            <figure>
                <artwork name="" align="left" alt=""><![CDATA[
module mod1 {
    namespace "urn:mod1";
    prefix m1;
    yang-version 1.1;

    revision 2025-01-01;

    container cont {
        leaf l1 {
            type string;
        }
    }
}
]]></artwork>
            </figure>
            <figure>
                <artwork name="" align="left" alt=""><![CDATA[
module mod1 {
    namespace "urn:mod1";
    prefix m1;
    yang-version 1.1;

    revision 2025-06-01;
    revision 2025-01-01;

    container cont {
        leaf l1 {
            type string;
        }
        leaf l2 {
            type decimal64 {
                fraction-digits 4;
            }
        }
    }

    leaf l3 {
        type uint8;
    }
}
]]></artwork>
            </figure>
            <sourcecode name="mod1_comparison.json" type=""
                    markers="false"><![CDATA[
{
  "ietf-yang-schema-comparison-output:schema-comparison": {
    "schema": [
      {
        "source": {
          "module": "mod1",
          "revision": "2025-01-01"
        },
        "target": {
          "module": "mod1",
          "revision": "2025-06-01"
        },
        "conformance": "backwards-compatible",
        "node-comparison": [
          {
            "node": "/mod1:cont/l2",
            "node-type": "leaf",
            "changed": [
              {
                "stmt": "node",
                "change": "added",
                "conformance": "backwards-compatible"
              }
            ],
            "new": {
              "status": "current",
              "config": true,
              "mandatory": false,
              "type": {
                "base-type": "decimal64",
                "fraction-digits": 4
              }
            }
          },
          {
            "node": "/mod1:l3",
            "node-type": "leaf",
            "changed": [
              {
                "stmt": "node",
                "change": "added",
                "conformance": "backwards-compatible"
              }
            ],
            "new": {
              "status": "current",
              "config": true,
              "mandatory": false,
              "type": {
                "base-type": "uint8"
              }
            }
          }
        ]
      }
    ]
  }
}
]]></sourcecode>
        </section>
        <section anchor="relaxed_length_module" title="Relaxed Length Module">
            <t>
                An example module comparison in which a typedef length
                restriction is relaxed and a new leaf is added.
            </t>
            <t>
                The generated diff includes both locally resolved and fully
                resolved changes. In the local comparison, the specific range
                change is reported as backward-compatible because the
                restriction was relaxed. In the fully resolved node comparison,
                the exact same change is reported because the leaf uses the
                same typedef, whose change also affects the leaf. The newly
                added leaf is also reported and marked as backward-compatible.
            </t>
            <figure>
                <artwork name="" type="" align="left" alt=""><![CDATA[
module mod1 {
    namespace "urn:mod2";
    prefix m2;
    yang-version 1.1;

    revision 2025-01-01;

    typedef my-string {
        type string {
            length "1..10";
        }
    }

    container cont {
        leaf l {
            type my-string;
        }
    }
}
]]></artwork>
            </figure>
            <figure>
                <artwork name="" type="" align="left" alt=""><![CDATA[
module mod1 {
    namespace "urn:mod2";
    prefix m2;
    yang-version 1.1;

    revision 2025-06-01;
    revision 2025-01-01;

    typedef my-string {
        type string {
            length "1..20";
        }
    }

    container cont {
        leaf l {
            type my-string;
        }

        leaf l2 {
            type int32;
        }
    }
}
]]></artwork>
            </figure>
            <sourcecode name="mod1_comparison.json" type=""
                    markers="false"><![CDATA[
{
  "ietf-yang-schema-comparison-output:schema-comparison": {
    "schema": [
      {
        "source": {
          "module": "mod2",
          "revision": "2025-01-01"
        },
        "target": {
          "module": "mod2",
          "revision": "2025-06-01"
        },
        "conformance": "backwards-compatible",
        "parsed-comparison": [
          {
            "parent-path": "/",
            "identifier": "my-string",
            "stmt-type": "typedef",
            "changed": [
              {
                "stmt": "length",
                "parent-stmt": "typedef",
                "change": "modified",
                "conformance": "backwards-compatible"
              }
            ],
            "old": {
              "type": {
                "name": "string",
                "length": {
                  "restriction": "1..10"
                }
              }
            },
            "new": {
              "type": {
                "name": "string",
                "length": {
                  "restriction": "1..20"
                }
              }
            }
          }
        ],
        "node-comparison": [
          {
            "node": "/mod2:cont/l",
            "node-type": "leaf",
            "changed": [
              {
                "stmt": "length",
                "change": "modified",
                "conformance": "backwards-compatible"
              }
            ],
            "old": {
              "status": "current",
              "config": true,
              "mandatory": false,
              "type": {
                "base-type": "string",
                "length": {
                  "interval": [
                    {
                      "min": "1",
                      "max": "10"
                    }
                  ]
                }
              }
            },
            "new": {
              "status": "current",
              "config": true,
              "mandatory": false,
              "type": {
                "base-type": "string",
                "length": {
                  "interval": [
                    {
                      "min": "1",
                      "max": "20"
                    }
                  ]
                }
              }
            }
          },
          {
            "node": "/mod2:cont/l2",
            "node-type": "leaf",
            "changed": [
              {
                "stmt": "node",
                "change": "added",
                "conformance": "backwards-compatible"
              }
            ],
            "new": {
              "status": "current",
              "config": true,
              "mandatory": false,
              "type": {
                "base-type": "int32"
              }
            }
          }
        ]
      }
    ]
  }
}
]]></sourcecode>
        </section>
    </section>
  </back>
</rfc>
<!-- Local Variables: -->
<!-- fill-column:120 -->
<!-- End: -->
