RESTCONF JSON identity had wrong namespace in sub-objetcs

This commit is contained in:
Olof hagsand 2019-08-09 14:39:38 +02:00
parent a57dbfc6f0
commit f319c18374
4 changed files with 39 additions and 3 deletions

View file

@ -246,12 +246,13 @@ nscache_get(cxobj *x,
return NULL;
}
/*! Set cached namespace. Replace if necessary
/*! Set cached namespace for specific namespace. Replace if necessary
* @param[in] x XML node
* @param[in] prefix Namespace prefix, or NULL for default
* @param[in] namespace Cached namespace to set (assume non-null?)
* @retval 0 OK
* @retval -1 Error
* @see nscache_replace to replace the whole context
*/
static int
nscache_set(cxobj *x,
@ -271,6 +272,29 @@ nscache_set(cxobj *x,
return retval;
}
/*! Set complete cached namespace context
* @param[in] x XML node
* @param[in] nsc Namespace context (note consumed, dont free)
* @retval 0 OK
* @retval -1 Error
* @see nscache_set set a single cache line
*/
int
nscache_replace(cxobj *x,
cvec *nsc)
{
int retval = -1;
if (x->x_ns_cache != NULL){
xml_nsctx_free(x->x_ns_cache);
x->x_ns_cache = NULL;
}
x->x_ns_cache = nsc;
retval = 0;
// done:
return retval;
}
/*! Clear cached namespace context
* Clear the whole namespace context, not just single cache lines
* @param[in] x XML node