-
-
Notifications
You must be signed in to change notification settings - Fork 222
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
Improve handling of "mixed content" with XML module #402
Comments
Looks like |
Exposing of mixed content through
Note that due to limitation in logic blank mixed content can not be included, so all-whitespace segments are not retained. This is unfortunately necessary to support use of indentation for non-mixed-content cases. I will leave this issue open for possible future improvements regarding POJO (typed) use cases: these will not yet allow more than one |
# Conflicts: # src/test/java/com/fasterxml/jackson/dataformat/xml/deser/JsonNodeBasicDeserTest.java
Could you please detail how is it supposed to be used with POJOs? I have this problem in 2.11.2, tried your solution with the 2.12.0-snapshot, created a similar case with a root element containing a value field with @JacksonXMLText annotation. |
@Ace2Pic As things are, this would not help use with POJOs, unfortunately. It does help with |
@cowtowncoder Thank you for your answer. It helped! |
@Ace2Pic ah yes, that makes sense! |
can you share the custom deserializer you wrote? thanks! |
Closing this due to following improvements that will be in 2.12:
Further improvements would be useful too but require specific ideas, and will likely need to go in 2.13 or later. |
This is a placeholder issue for improving how Jackson handles XML content like:
and other cases where a nesting level has both element(s) and at least one non-blank text value (content other than whitespace).
Currently such content can not be supported at all, and it is difficult to really find a general way of mapping this into POJOs.
However, it should be possible to have some level of support, for example maybe allow reading into
JsonNode
in some form -- considering that such text content could perhaps be mapped into empty key (and assuming handling of repeated Object keys can be resolved).They may be other approaches too; to be discussed here.
The text was updated successfully, but these errors were encountered: