<p>Hi all,</p>
<p>I'm currently implementing this change (new mandatory “version“ attribute in BV 1.1 XML descriptors) within the RI (see HV-595). The basic idea is to</p>
<p>* examine the root element for the version attribute using a parser (Stax in our case) and then<br>
* unmarshal the descriptor with JAXB, using the right XSD based on the retrieved version.</p>
<p>So I have to access the input streams representing the descriptors twice. This is no problem for the streams we're opening ourselves (validation.xml), but it could be an issue for streams passed via Configuration#addMapping().</p>
<p>I can see the following options now:</p>
<p>* read descriptor streams into a string first which then can be processed several times. Alternatively wrap any streams not supporting the mark/reset contract into a BufferedInputStream.<br>
* demand in the spec that any passed input stream must support mark/reset. This would also be beneficial for the scenario of creating several factories from one Configuration, which we discussed a while ago. But obviously this would be a non compatible change for 1.0 clients passing non resettable streams to addMapping().</p>
<p>Any thoughts?</p>
<p>--Gunnar</p>
<div class="gmail_quote">Am 24.06.2012 11:46 schrieb "Gunnar Morling" <<a href="mailto:gunnar@hibernate.org" target="_blank">gunnar@hibernate.org</a>>:<br type="attribution"></div>