I want do partial unmarshaling of big XML.
XML has following structure:
<Records>
<Contract>
...
</Contract>
<Contract>
...
</Contract>
...
<Contract>
...
</Contract>
<Contract>
...
</Contract>
</Records>
And result class generated with XJC:
- Records
|- Contract
If i follow these(sample from jaxb-ri), i get error:
Exception in thread "main" javax.xml.bind.UnmarshalException: unexpected element (uri:"http://somedomain.com", local:"Contract"). Expected elements are <{http://somedomain.com}Records>
If i use:
<jaxb:globalBindings localScoping="toplevel"/>
I get error:
org.xml.sax.SAXParseException: A class/interface with the same name "com.my.package.Text" is already in use. Use a class customization to resolve this conflict.
But i need change many classes. And this is not solution.