From 99deddb47e868574c84f828e3c48842a5333ae35 Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Tue, 6 Feb 2024 20:15:48 +0100 Subject: [PATCH] Fixed: Problem with cl:ignore attribute for show compare --- lib/src/clixon_xml_map.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/src/clixon_xml_map.c b/lib/src/clixon_xml_map.c index 41ce1bac..d7fae751 100644 --- a/lib/src/clixon_xml_map.c +++ b/lib/src/clixon_xml_map.c @@ -614,8 +614,18 @@ xml_tree_equal(cxobj *x0, if ((yc0 = xml_spec(x0c)) != NULL){ if (yang_extension_value(yc0, "ignore-compare", CLIXON_LIB_NS, &extflag, NULL) < 0) goto done; - if (extflag) - goto ok; + if (extflag){ /* skip */ + x0c = xml_child_each(x0, x0c, CX_ELMNT); + continue; + } + } + if ((yc1 = xml_spec(x1c)) != NULL){ + if (yang_extension_value(yc1, "ignore-compare", CLIXON_LIB_NS, &extflag, NULL) < 0) + goto done; + if (extflag){ /* skip */ + x1c = xml_child_each(x1, x1c, CX_ELMNT); + continue; + } } /* Both x0c and x1c exists, check if they are yang-equal. */ if ((eq = xml_cmp(x0c, x1c, 0, 0, NULL)) != 0){ @@ -625,8 +635,6 @@ xml_tree_equal(cxobj *x0, /* xml-spec NULL could happen with anydata children for example, * if so, continue compare children but without yang */ - yc0 = xml_spec(x0c); - yc1 = xml_spec(x1c); if (yc0 && yc1 && yc0 != yc1){ /* choice */ goto done; }