From ec4d26febf9f6b04b4d2129206f2f99a4f25218e Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Wed, 26 May 2021 14:00:20 +0200 Subject: [PATCH] * Fixed again: [xpath function count did not work properly #224](https://github.com/clicon/clixon/issues/224) * Must statements namespace context were given by yang node, but this is not correct, should be xml --- lib/src/clixon_validate.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/src/clixon_validate.c b/lib/src/clixon_validate.c index cf3c7143..5c9c7188 100644 --- a/lib/src/clixon_validate.c +++ b/lib/src/clixon_validate.c @@ -1211,8 +1211,9 @@ xml_yang_validate_all(clicon_handle h, if (yang_keyword_get(yc) != Y_MUST) continue; xpath = yang_argument_get(yc); /* "must" has xpath argument */ - if (xml_nsctx_yang(yc, &nsc) < 0) - goto done; + /* the context node is the node in the accessible tree for + * which the "must" statement is defined. */ + nsc = NULL; if ((nr = xpath_vec_bool(xt, nsc, "%s", xpath)) < 0) goto done; if (!nr){