Ignoring the fact on whether the code is valid or not, to work around it we cannot use this resetting approach. We could try to process the input stream only once and make use of XMLEventReader#peek to ensure that extracting the schema version is not processing too much of the stream causing the unmarshaller to fail. This will require some restructuring of the existing code.
|