Ich möchte teilweise Unmarshaling von großen XML.Partial-Unmarshalling mit JAXB
XML hat folgende Struktur:
<Records>
<Contract>
...
</Contract>
<Contract>
...
</Contract>
...
<Contract>
...
</Contract>
<Contract>
...
</Contract>
</Records>
und Ergebnisklasse erzeugt mit XJC:
- Records
|- Contract
Wenn i these (Probe aus jaxb-ri) folgen, erhalte ich Fehler:
Exception in thread "main" javax.xml.bind.UnmarshalException: unexpected element (uri:"http://somedomain.com", local:"Contract"). Expected elements are <{http://somedomain.com}Records>
Wenn ich verwende:
<jaxb:globalBindings localScoping="toplevel"/>
ich Fehler:
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.
Aber ich brauche viele Klassen zu ändern. Und das ist keine Lösung.
Danke, es funktioniert perfekt! – Margaret