* Added sorting of YANG statements

* Some openconfig specs seem to have use/when before a "config" which it depends on. This leads to XML encoding being in the "wrong order.
  * When parsing, clixon now sorts container/list statements so that sub-statements with WHEN are put last.
  * See [Statements given in "load set" are order dependent](https://github.com/clicon/clixon/issues/287)
* Fixed: [Statements given in "load set" are order dependent](https://github.com/clicon/clixon/issues/287)
This commit is contained in:
Olof hagsand 2021-11-16 14:28:16 +01:00
parent a64464beda
commit acc9c083a4
11 changed files with 181 additions and 39 deletions

View file

@ -142,7 +142,7 @@ tleaf(cxobj *x)
return (xml_child_nr_notype(xc, CX_ATTR) == 0);
}
/*! Print an XML tree structure to an output stream and encode chars "<>&"
/*! Print an XML tree structure from an auto-cli env to stdout and encode chars "<>&"
*
* @param[in] xn clicon xml tree
* @param[in] level how many spaces to insert before each line
@ -322,6 +322,7 @@ cli_xml2txt(cxobj *xn,
* @param[in] prepend Print this text in front of all commands.
* @param[in] gt option to steer cli syntax
* @param[in] fn Callback to make print function
* @see xml2cli
*/
int
cli_xml2cli(cxobj *xn,