Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
    Bookmark Topic Watch Topic
  • New Topic

Problem with JAXB if new tag is added to XML

 
Nisha lakshminaraya
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 49
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Sheriff
Posts: 21291
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Report post to moderator
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.
 
    Bookmark Topic Watch Topic
  • New Topic