yin parser CHANGE add name2nsname function
diff --git a/src/parser_yin.c b/src/parser_yin.c
index 914f6f9..46d8028 100644
--- a/src/parser_yin.c
+++ b/src/parser_yin.c
@@ -2846,6 +2846,19 @@
return LY_SUCCESS;
}
+char *
+name2nsname(struct yin_parser_ctx *ctx, const char *name, size_t name_len, const char *prefix, size_t prefix_len)
+{
+ const struct lyxml_ns *ns = lyxml_ns_get(&ctx->xml_ctx, prefix, prefix_len);
+ size_t len = strlen(ns->uri) + name_len + 1;
+
+ char *temp = malloc(sizeof(*temp) * len);
+ strcpy(temp, ns->uri);
+ strncat(temp, name, name_len);
+
+ return lydict_insert_zc(ctx->xml_ctx.ctx, temp);
+}
+
LY_ERR
yin_parse_content(struct yin_parser_ctx *ctx, struct yin_subelement *subelem_info, size_t subelem_info_size,
const char **data, enum ly_stmt current_element, const char **text_content, struct lysp_ext_instance **exts)