• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question JAXB 2.0 ValidationEventHandler

 
Sukumar Gaade
Greenhorn
Posts: 24
  • 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
  • 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
  • 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
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic