Description
Normally XML document like:
<root>
<value>3</value>
</root>
would be exposed as equivalent to JSON
{ "value" : "3" }
since that is typically the straight-forward and suitable representation for databinding use.
But when reading "as a tree", into JsonNode
, this will lose a small part of information, namely the name of root element.
User has no way to access this information, and although technically we could store it for access, API would feel clunky.
So instead perhaps there should be an option to instead expose said document like so:
{
"root" : {
"value" : "3"
}
}
This would be particularly useful when coupled with the recently added ToXmlGenerator.Feature.UNWRAP_ROOT_OBJECT_NODE
(added via #441) as users could then get full round-tripping of XML documents.
Note: one potential problem we do have is the "too late" passing of format-feature flags -- it would be particularly gnarly problem here.