@@ -106,7 +106,6 @@ lyd_parse(const struct ly_ctx *ctx, struct lyd_node *parent, struct lyd_node **f
106106 struct ly_set parsed = {0 };
107107 uint32_t i , int_opts = 0 ;
108108 const struct ly_err_item * eitem ;
109- ly_bool subtree_sibling = 0 ;
110109
111110 assert (ctx && (parent || first_p ));
112111
@@ -119,23 +118,18 @@ lyd_parse(const struct ly_ctx *ctx, struct lyd_node *parent, struct lyd_node **f
119118 in -> func_start = in -> current ;
120119
121120 /* set internal options */
122- if (!(parse_opts & LYD_PARSE_SUBTREE )) {
123- int_opts = LYD_INTOPT_WITH_SIBLINGS ;
124- }
121+ int_opts = LYD_INTOPT_WITH_SIBLINGS ;
125122
126123 /* parse the data */
127124 switch (format ) {
128125 case LYD_XML :
129- r = lyd_parse_xml (ctx , parent , first_p , in , parse_opts , val_opts , int_opts , & parsed ,
130- & subtree_sibling , & lydctx );
126+ r = lyd_parse_xml (ctx , parent , first_p , in , parse_opts , val_opts , int_opts , & parsed , & lydctx );
131127 break ;
132128 case LYD_JSON :
133- r = lyd_parse_json (ctx , parent , NULL , first_p , in , parse_opts , val_opts , int_opts , & parsed ,
134- & subtree_sibling , & lydctx );
129+ r = lyd_parse_json (ctx , parent , NULL , first_p , in , parse_opts , val_opts , int_opts , & parsed , & lydctx );
135130 break ;
136131 case LYD_LYB :
137- r = lyd_parse_lyb (ctx , parent , first_p , in , parse_opts , val_opts , int_opts , & parsed ,
138- & subtree_sibling , & lydctx );
132+ r = lyd_parse_lyb (ctx , parent , first_p , in , parse_opts , val_opts , int_opts , & parsed , & lydctx );
139133 break ;
140134 case LYD_UNKNOWN :
141135 LOGARG (ctx , format );
@@ -192,8 +186,6 @@ lyd_parse(const struct ly_ctx *ctx, struct lyd_node *parent, struct lyd_node **f
192186 lyd_free_all (* first_p );
193187 * first_p = NULL ;
194188 }
195- } else if (subtree_sibling ) {
196- rc = LY_ENOT ;
197189 }
198190 ly_set_erase (& parsed , NULL );
199191 return rc ;
@@ -304,7 +296,7 @@ lyd_parse_value_fragment(const struct ly_ctx *ctx, const char *path, struct ly_i
304296
305297 /* parse the json value */
306298 LY_CHECK_GOTO (ret = lyd_parse_json (ctx , new_last_parent , new_node_schema , new_last_parent ? NULL : & new_top_parent ,
307- in , parse_options , validate_options , 0 , NULL , NULL , NULL ), cleanup );
299+ in , parse_options , validate_options , 0 , NULL , NULL ), cleanup );
308300
309301 /* when setting keys they have to have a correct value (same as in the path) */
310302 if (lysc_is_key (new_node_schema )) {
@@ -457,13 +449,13 @@ lyd_parse_op(const struct ly_ctx *ctx, struct lyd_node *parent, struct ly_in *in
457449 /* parse the data */
458450 switch (format ) {
459451 case LYD_XML :
460- rc = lyd_parse_xml (ctx , parent , & first , in , parse_options , val_opts , int_opts , & parsed , NULL , & lydctx );
452+ rc = lyd_parse_xml (ctx , parent , & first , in , parse_options , val_opts , int_opts , & parsed , & lydctx );
461453 break ;
462454 case LYD_JSON :
463- rc = lyd_parse_json (ctx , parent , NULL , & first , in , parse_options , val_opts , int_opts , & parsed , NULL , & lydctx );
455+ rc = lyd_parse_json (ctx , parent , NULL , & first , in , parse_options , val_opts , int_opts , & parsed , & lydctx );
464456 break ;
465457 case LYD_LYB :
466- rc = lyd_parse_lyb (ctx , parent , & first , in , parse_options , val_opts , int_opts , & parsed , NULL , & lydctx );
458+ rc = lyd_parse_lyb (ctx , parent , & first , in , parse_options , val_opts , int_opts , & parsed , & lydctx );
467459 break ;
468460 case LYD_UNKNOWN :
469461 LOGARG (ctx , format );
0 commit comments