Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Unknown Elements in JAXB 1.6

Unknown Elements in JAXB 1.6

Unknown Elements in JAXB 1.6

Hello. I am an experience Java developer but have never used JAXB before. My client (who is a bit behind the times) is using JAXB 1.6 and Java 1.4. For various reasons, I cannot upgrade at the moment.

The problem I am having is that one of the groups we interface with has decided to add some new XML tags without telling us. I'm trying to resolve the issue without hardcoding the new tags because we don't need them at all. I want to completely ignore them.

Does anyone know of a customization or XSD change that I can use to globally ignore any new tags that we don't specify in the XSD.

In other words, the XML should be validated based on the elements in the XSD and any other tags should be ignored without an exception.


RE: Unknown Elements in JAXB 1.6

TonHu, I think you might have posted this in the wrong thread.  My question is about JAXB and the URL you posted leads to a page having nothing to do with Java at all.

RE: Unknown Elements in JAXB 1.6

@tommyc7 Oh yes it is just fine for you, it describes how you should define an "optional" element in your xsd, so jaxb doesn't choke if it doesn't get that element.

The Epic Fail here is that the interface was changed after publication. It happens 'all the time', but that doesn't mean it's OK!

The Java code on stackoverflow, to ignore any exception on unknown elements, is more like a brute force way of getting things done. It might be enough, but you can still talk the other party into sharing the required interface definitions.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close