XML printer REFACTOR unify/simplify way of getting libyang context from a data node
@@ -182,7 +182,7 @@ xml_print_meta(struct xmlpr_ctx *ctx, const struct lyd_node *node)
if (((node->flags & LYD_DEFAULT) && (ctx->options & (LYD_PRINT_WD_ALL_TAG | LYD_PRINT_WD_IMPL_TAG))) ||
((ctx->options & LYD_PRINT_WD_ALL_TAG) && lyd_is_default(node))) {
/* we have implicit OR explicit default node, print attribute only if context include with-defaults schema */
- mod = ly_ctx_get_module_latest(node->schema->module->ctx, "ietf-netconf-with-defaults");
+ mod = ly_ctx_get_module_latest(LYD_CTX(node), "ietf-netconf-with-defaults");
if (mod) {
ly_print_(ctx->out, " %s:default=\"true\"", xml_print_ns(ctx, mod->ns, mod->prefix, 0));
}
