posted 15 years ago
My current project receives XML files and unmarshals them using JiBX. When unmarshaling a message, unknown attributes on an element are ignored, but any elements that are not expected cause parsing exceptions to occur.
The system that sends us the XML messages says that they are going to start sending us XML messages that could contain elements that our JiBX bindings are unaware of. Is there a way to ignore XML elements that JiBX isn't expecting?
Expected in Jibx Bindings:
<Customer name="SomeGuy" occuptation="developer"/>
Future XML:
<Customer name="SomeGuy" occupation="developer">
<telelphoneNumbers>
<PhoneNumber type="work" number="5555555555"/>
<PhoneNumber type="home" number="5555554444"/>
</telephoneNumbers>
</Customer>
In the future XML, we don't care about the telephone numbers, we just want to be able to parse the xml with the unexpected element in it.
Thanks.