On 05/04/2022 00:34, Robert Varga wrote:

On 04/04/2022 13:48, Jernej Tuljak wrote:
    > If both "leaf" data nodes are instantiated (XML encoding) as
    part of <rpc> for "foo", does <x> come before or after <y> (in
    document order)?

    Augmented-in nodes come after other nodes.



Maybe this is an implementation convention, but the RFC says they are encoded in any order.
https://datatracker.ietf.org/doc/html/rfc7950#section-7.17.2


You are referring to this:

    When a node is augmented, the augmenting child nodes are encoded as
    subelements to the augmented node, in any order.

This implies interleaving of augmenting and non-augmenting child nodes within "input" parameters for XML encoding?

Yes. There is no semantic difference in directly-defined on augmenting nodes, especially in 'uses/augment' case -- they share the same namespace, so at the document level (i.e. effective model) there is no difference between the two.

Any ordering should be treated as an implementation artifact. In particular this declaration:

rpc foo {
  grouping foo {
    container foo {
      leaf foo {
        type string;
      }
    }
  }

  input {
    uses foo {
      augment foo {
        leaf bar {
          type uint8;
        }
      }
    }
  }
}

is completely equivalent to:

rpc foo {
  input {
    container foo {
      leaf bar {
        type uint8;
      }
      leaf foo {
        type string;
      }
    }
  }
}

The presence of the intermediate grouping is a pure module-internal modeling detail. I believe introducing/removing the grouping is a non-breaking change as per RFC6020 (if memory serves right).

Module updating rules state this:

   o  Any set of data definition nodes may be replaced with another set
      of syntactically and semantically equivalent nodes.  For example,
      a set of leafs may be replaced by a "uses" statement of a grouping
      with the same leafs.

and this:

   In statements that have any data definition statements as
   substatements, those data definition substatements MUST NOT be
   reordered.

Can you state that your second example may be rewritten into your first one while retaining semantic equivalence? For the second example, it is clear that XML encoding for that container imposes ordering on <bar> and <foo> (in that order), for the first, this is no longer true.

Jernej


Regards,
Robert

_______________________________________________
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to