-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Concept of map_all
with JSON, YAML and TOML?
#139
Comments
@ronaldtse What i have in mind is that the
Am I going in the right direction or do we need to change something here? |
I believe this is correct. I almost wanted to say that "an element that uses map_all means it is a leaf node and can be represented using a Value class", but it is not true because an XML element contains element content as well as attribute data. We have seen cases where the XML element's attribute data are parsed but the element content is treated as Since a Value class only has a single value, it cannot handle element content + attributes. So there is still value in |
@ronaldtse I have worked on it and realized that the above-given examples will change slightly because: Even if we have a single key in the input hash, we still do not know about the key since we don’t have root in key-value formats just like we have in XML So the implementation will go like this: Sample Input:
In the above sample input, we don’t have any parent node whose children we can fetch and assign the attribute value after serializing it. It will become:
Let me know what do you suggest about this. Thanks |
I think what I don't understand is, how does the concept of
map_all
work with JSON, YAML and TOML?JSON is like:
{ "attr" : "value" }
. Does that mean map_all will give the raw value of{ "attr" : "value" }
?YAML is like:
attr: value
. Does that mean map_all will give the raw value?Does
map_all
on this element produce:Originally posted by @ronaldtse in #129 (comment)
The text was updated successfully, but these errors were encountered: