You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found a weird error when trying to parse XML documents with an com.fasterxml.jackson.dataformat.xml.XmlMapper. If an XML element has no attribute and contains both text nodes and sub-elements, the XML parser fails with the following exception:
Exception in thread "main" java.io.IOException: Expected END_ELEMENT, got event of type 1
at com.fasterxml.jackson.dataformat.xml.deser.XmlTokenStream.skipEndElement(XmlTokenStream.java:180)
at com.fasterxml.jackson.dataformat.xml.deser.FromXmlParser.nextToken(FromXmlParser.java:558)
at com.fasterxml.jackson.databind.deser.std.BaseNodeDeserializer.deserializeObject(JsonNodeDeserializer.java:223)
at com.fasterxml.jackson.databind.deser.std.JsonNodeDeserializer.deserialize(JsonNodeDeserializer.java:69)
at com.fasterxml.jackson.databind.deser.std.JsonNodeDeserializer.deserialize(JsonNodeDeserializer.java:15)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3798)
at com.fasterxml.jackson.databind.ObjectMapper.readTree(ObjectMapper.java:2381)
at test.mvn.TestJackson.main(TestJackson.java:18)
Hello,
I found a weird error when trying to parse XML documents with an
com.fasterxml.jackson.dataformat.xml.XmlMapper
. If an XML element has no attribute and contains both text nodes and sub-elements, the XML parser fails with the following exception:Example of XML document that produces the error
If the parent element has at least one attribute, the parsing is OK.
Example of XML document that does not produce any error:
The java code used:
Reproduced with 2.8.0 and 2.8.7
Not reproduced with 2.7.8
The text was updated successfully, but these errors were encountered: