diff --git a/lib/clixon/clixon_xml.h b/lib/clixon/clixon_xml.h index d56d0f71..fd400956 100644 --- a/lib/clixon/clixon_xml.h +++ b/lib/clixon/clixon_xml.h @@ -117,11 +117,12 @@ enum cxobj_type {CX_ERROR=-1, * XXX: lacks support for incoming restconf rpc, see api_operations_post_input) */ enum yang_bind{ - YB_MODULE=0, /* Search for matching yang binding among top-level symbols of Yang modules */ + YB_NONE=0, /* Dont do Yang binding */ + YB_MODULE, /* Search for matching yang binding among top-level symbols of Yang modules */ YB_PARENT, /* Assume yang binding of existing parent and match its children by name */ - YB_NONE, /* Dont do Yang binding */ + #ifdef NYI - YB_RPC, /* Assume top-level xml is an netconf RPC message (NYI) */ + YB_RPC, /* Assume top-level xml is an netconf RPC message */ #endif }; typedef enum yang_bind yang_bind; diff --git a/lib/src/clixon_xml_map.c b/lib/src/clixon_xml_map.c index 61a3c0f2..4c5ab44d 100644 --- a/lib/src/clixon_xml_map.c +++ b/lib/src/clixon_xml_map.c @@ -1653,7 +1653,11 @@ assign_namespaces(cxobj *x0, /* source */ } } else{ - y = xml_spec(x0); + if ((y = xml_spec(x0)) == NULL){ + clicon_err(OE_YANG, ENOENT, "XML %s does not have yang spec", + xml_name(x0)); + goto done; + } if ((prefix1 = strdup(yang_find_myprefix(y))) == NULL){ clicon_err(OE_UNIX, errno, "strdup"); goto done; diff --git a/test/test_search_index.sh b/test/test_search_index.sh index 6f6d1e6e..45b5c4cb 100755 --- a/test/test_search_index.sh +++ b/test/test_search_index.sh @@ -6,7 +6,7 @@ # - not a key int # - key in an ordered-by user # - key in state data -# Use instance-id for tests,since api-path can only handle keys, and xpath is too complex. +# Use instance-id for tests, since api-path can only handle keys, and xpath is too complex. # Magic line must be first in script (see README.md) s="$_" ; . ./lib.sh || if [ "$s" = $0 ]; then exit 0; else return 0; fi @@ -82,7 +82,7 @@ for (( ii=0; ii<10; ii++ )); do done # Then measure time for index and non-index, assume correct -# For small nr, the tiome to parse is so much larger than searching (and also parsing involves +# For small nr, the time to parse is so much larger than searching (and also parsing involves # searching) which makes it hard to make a test comparing accessing the index variable "i" and the # non-index variable "j". new "index search latency i=$rndi"