0

Is there any way to specify the order of containers inside a grouping, instead of letting the system do it randomly?

Example:

grouping common-config-def {
    container myContent1 {
      uses myContent1-def;
    }
    container myContent2 {
      uses myContent2-def;
    }
    container myContent3 {
      uses myContent3-def;
    }    
}
Nogoseke
  • 969
  • 1
  • 12
  • 24
Trung
  • 1
  • 1

1 Answers1

0

The answer is no, you have no control over this, but most implementations will probably follow definition order when consuming the model.

Not sure why such a requirement would be needed, but I'm assuming the issue is model-based instance data encoding. When encoding data, the data nodes may appear in any order with the exception of RPC/action input and output data, list key data nodes and "ordered-by user" list entries.

The specification is quite clear on this, for example, if your grouping were to be used in a container, the following would apply when encoding the data of that container:

The container's child nodes are encoded as subelements to the container element. If the container defines RPC or action input or output parameters, these subelements are encoded in the same order as they are defined within the "container" statement. Otherwise, the subelements are encoded in any order.

RFC7950, Section 7.5.7.

Community
  • 1
  • 1
predi
  • 5,528
  • 32
  • 60