types CHANGE redesign storing canonical values
Canonical values are not available for all the types and the type's
printer should be used to get string representation instead of trying to
get string value directly from the lyd_value. So, the canonical value is
now much more hidden in lyd_value structure. On the other hand, there is
newly available original string representation of the value (some of the
types already needed it), which is always present no matter of the
value's type.
diff --git a/src/parser_xml.c b/src/parser_xml.c
index d967fe9..e0a0623 100644
--- a/src/parser_xml.c
+++ b/src/parser_xml.c
@@ -570,7 +570,7 @@
result_trees = lyd_trees_new(1, *result);
}
/* validate and store the value of the node */
- ret = lyd_value_parse(node, node->value.canonized, node->value.canonized ? strlen(node->value.canonized) : 0, 0, 1,
+ ret = lyd_value_parse(node, node->value.original, strlen(node->value.original), 0, 1,
lydxml_resolve_prefix, ctx, LYD_XML, result_trees);
lyd_trees_free(result_trees, 0);
if (ret) {
@@ -589,7 +589,7 @@
result_trees = lyd_trees_new(1, *result);
}
/* validate and store the value of the node */
- ret = lyd_value_parse_attr(attr, attr->value.canonized, attr->value.canonized ? strlen(attr->value.canonized) : 0, 0, 1,
+ ret = lyd_value_parse_attr(attr, attr->value.original, strlen(attr->value.original), 0, 1,
lydxml_resolve_prefix, ctx, LYD_XML, result_trees);
lyd_trees_free(result_trees, 0);
if (ret) {