This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question JAXB 2.0 ValidationEventHandler

 
Sukumar Gaade
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am unmarshalling an xml using JAXB 2.0 as below:


If the input xml is invalid it shows the exception message saying:


This exception says that the name element is not expected which is fine. If this is the case then i need to the parent node of the element where the exception occurred and should perform some business logic. I am not able to get the parent node. I tried this:

but, I get null. How do i get the parent node?

Could anyone please help me out.

Thanks,
Suku
 
Evgeniy Bulanov
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sukumar Gaade,

I have the same problem? Have you solved it?

 
Corneil du Plessis
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to use a different method and supply the class you expect.



Sukumar Gaade wrote:Hi,

I am unmarshalling an xml using JAXB 2.0 as below:


If the input xml is invalid it shows the exception message saying:


This exception says that the name element is not expected which is fine. If this is the case then i need to the parent node of the element where the exception occurred and should perform some business logic. I am not able to get the parent node. I tried this:

but, I get null. How do i get the parent node?

Could anyone please help me out.

Thanks,
Suku
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic