Skip to content

Commit a358f94

Browse files
committed
xml parser BUGFIX missing data module callback call
It was not called for descendant nodes, but it is required in case of foreign augments. Fixes sysrepo/sysrepo#775
1 parent 9a30517 commit a358f94

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/parser_xml.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,15 @@ xml_parse_data(struct ly_ctx *ctx, struct lyxml_elem *xml, struct lyd_node *pare
184184
/* parsing some internal node, we start with parent's schema pointer */
185185
schema = xml_data_search_schemanode(xml, parent->schema->child, options);
186186

187-
if (schema) {
188-
if (!lys_node_module(schema)->implemented && ctx->data_clb) {
187+
if (ctx->data_clb) {
188+
if (schema && !lys_node_module(schema)->implemented) {
189189
ctx->data_clb(ctx, lys_node_module(schema)->name, lys_node_module(schema)->ns,
190190
LY_MODCLB_NOT_IMPLEMENTED, ctx->data_clb_data);
191+
} else if (!schema) {
192+
if (ctx->data_clb(ctx, NULL, xml->ns->value, 0, ctx->data_clb_data)) {
193+
/* context was updated, so try to find the schema node again */
194+
schema = xml_data_search_schemanode(xml, parent->schema->child, options);
195+
}
191196
}
192197
}
193198
}

0 commit comments

Comments
 (0)