Skip to content

Commit b106081

Browse files
committed
parser xml BUGFIX condition changed in the meantime
1 parent 3c4b989 commit b106081

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/parser_xml.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -920,6 +920,7 @@ lydxml_subtree_any(struct lyd_xml_ctx *lydctx, const struct lysc_node *snode, co
920920
struct lyxml_ctx *xmlctx = lydctx->xmlctx;
921921
uint32_t prev_parse_opts = lydctx->parse_opts, prev_int_opts = lydctx->int_opts;
922922
char *val = NULL;
923+
ly_bool datatree_val = 0;
923924

924925
*node = NULL;
925926

@@ -935,6 +936,7 @@ lydxml_subtree_any(struct lyd_xml_ctx *lydctx, const struct lysc_node *snode, co
935936
/* create empty node first */
936937
r = lyd_create_any(snode, NULL, LYD_ANYDATA_DATATREE, 1, 0, node);
937938
LY_CHECK_ERR_GOTO(r, rc = r, cleanup);
939+
datatree_val = 1;
938940
} else {
939941
/* use an arbitrary text value for anyxml */
940942
val = strndup(xmlctx->value, xmlctx->value_len);
@@ -957,7 +959,7 @@ lydxml_subtree_any(struct lyd_xml_ctx *lydctx, const struct lysc_node *snode, co
957959
r = lyxml_ctx_next(xmlctx);
958960
LY_CHECK_ERR_GOTO(r, rc = r, cleanup);
959961

960-
if (xmlctx->ws_only) {
962+
if (datatree_val) {
961963
if (lydctx->parse_opts & LYD_PARSE_ANYDATA_STRICT) {
962964
/* explicit strict data parsing */
963965
lydctx->parse_opts |= LYD_PARSE_STRICT;

0 commit comments

Comments
 (0)