GeeCON Prague 2014*
The moose likes XML and Related Technologies and the fly likes Problem with JAXB if new tag is added to XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply locked New topic
Author

Problem with JAXB if new tag is added to XML

Nisha lakshminaraya
Ranch Hand

Joined: Feb 23, 2010
Posts: 30
Hi,

I have XSD file where i am defining all the XML tags.I am compiling schema to generate all the java class's. I have added new tag to XML and not defined same in XSD. But when i am trying to unmarshall i am getting an error saying "Element not found"

Please help me to solve this

Thanks,
Nisha
bala nannaka
Ranch Hand

Joined: Apr 02, 2007
Posts: 49
When you unmarshall the xml to generate the java class the Jaxb uses your scema to generate the handlers for each element type and generate a equivalent jave types for that. If you had a new element in xml and not updated in your schema it doen't know to generate a equivalent java type and throws the exception . Please make sure of your all xml elements are matching with the given schema.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

I'm locking this duplicate post -- if you want to discuss the question, please reply to the other copy here: http://www.coderanch.com/t/609361/XML/JAXB-tag-added-XML.
 
GeeCON Prague 2014
 
subject: Problem with JAXB if new tag is added to XML