xpath BUGFIX nested extension data nodes node check
@@ -5688,9 +5688,9 @@ moveto_node_check(const struct lyd_node *node, enum lyxp_node_type node_type, co
/* module check */
if (moveto_mod) {
- if (!(node->flags & LYD_EXT) && (node->schema->module != moveto_mod)) {
+ if ((set->ctx == LYD_CTX(node)) && (node->schema->module != moveto_mod)) {
return LY_ENOT;
- } else if ((node->flags & LYD_EXT) && strcmp(node->schema->module->name, moveto_mod->name)) {
+ } else if ((set->ctx != LYD_CTX(node)) && strcmp(node->schema->module->name, moveto_mod->name)) {
return LY_ENOT;
}
}
@@ -5705,9 +5705,9 @@ moveto_node_check(const struct lyd_node *node, enum lyxp_node_type node_type, co
/* name check */
if (node_name) {
- if (!(node->flags & LYD_EXT) && (node->schema->name != node_name)) {
+ if ((set->ctx == LYD_CTX(node)) && (node->schema->name != node_name)) {
return LY_ENOT;
- } else if ((node->flags & LYD_EXT) && strcmp(node->schema->name, node_name)) {
+ } else if ((set->ctx != LYD_CTX(node)) && strcmp(node->schema->name, node_name)) {
return LY_ENOT;
}
}
