* New XML parsing API:
* `clixon_xml_parse_string()` * `clixon_xml_parse_file()` * New JSON parsing API, with same signature as XML parsing: * `clixon_json_parse_string()` * `clixon_xml_parse_file()` * XML YANG binding API have been rearranged as follows: * `xml_bind_yang_rpc()` * `xml_bind_yang_rpc_reply()` * `xml_bind_yang()` * `xml_bind_yang0()`
This commit is contained in:
parent
c4b0491754
commit
09a2e09848
54 changed files with 590 additions and 711 deletions
|
|
@ -140,19 +140,14 @@ main(int argc, char **argv)
|
|||
clicon_debug(1, "xpath:%s", xpath);
|
||||
if ((yspec = yspec_new()) == NULL)
|
||||
goto done;
|
||||
#if 1
|
||||
if (yang_spec_parse_file(h, filename, yspec) < 0)
|
||||
goto done;
|
||||
#else
|
||||
if (yang_parse_file(fd, "yang test", yspec) == NULL)
|
||||
goto done;
|
||||
#endif
|
||||
/* Parse base XML */
|
||||
if (xml_parse_string(x0str, yspec, &x0) < 0){
|
||||
if (clixon_xml_parse_string(x0str, YB_MODULE, yspec, &x0, NULL) < 0){
|
||||
clicon_err(OE_XML, 0, "Parsing base xml: %s", x0str);
|
||||
goto done;
|
||||
}
|
||||
if (xml_bind_yang(x0, yspec, NULL) < 0)
|
||||
if (xml_bind_yang(x0, YB_MODULE, yspec, NULL) < 0)
|
||||
goto done;
|
||||
if ((xb = xpath_first(x0, NULL, "%s", xpath)) == NULL){
|
||||
clicon_err(OE_XML, 0, "xpath: %s not found in x0", xpath);
|
||||
|
|
@ -163,11 +158,11 @@ main(int argc, char **argv)
|
|||
xml_print(stderr, xb);
|
||||
}
|
||||
/* Parse insert XML */
|
||||
if (xml_parse_string(xistr, yspec, &xi) < 0){
|
||||
if (clixon_xml_parse_string(xistr, YB_MODULE, yspec, &xi, NULL) < 0){
|
||||
clicon_err(OE_XML, 0, "Parsing insert xml: %s", xistr);
|
||||
goto done;
|
||||
}
|
||||
if (xml_bind_yang(xi, yspec, NULL) < 0)
|
||||
if (xml_bind_yang(xi, YB_MODULE, yspec, NULL) < 0)
|
||||
goto done;
|
||||
if ((xi = xpath_first(xi, NULL, "%s", xpath)) == NULL){
|
||||
clicon_err(OE_XML, 0, "xpath: %s not found in xi", xpath);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue