Is there any way to just ignore an element from Jaxb parsing? I have a large XML file, and if I could ignore one of the large, complex elements, then it would probably parse
Assuming your JAXB model looks like this:
@XmlRootElement(name="foo")
public class Foo {
@XmlElement(name="element1")
String element1;
@XmlElement(name="element2")
String element2;
@XmlElement(name="bar")
Bar bar;
}
then simply removing the bar field from Foo will skip the element in the input document.
Alternatively, annotated the field with @XmlTransient instead of @XmlElement, and it will also be skipped.