public static void validateFiles(File[] instanceFiles,
SchemaTypeLoader sLoader,
final XmlOptions options)
{
final ValidatingXMLStreamReader vsr = new ValidatingXMLStreamReader();
final Collection errors = new ArrayList();
for (int i = 0; i < instanceFiles.length; i++) {
final File file = instanceFiles[i];
final String path = file.getPath();
long time = 0;
errors.clear();
try {
final FileInputStream fis = new FileInputStream(file);
final XMLStreamReader rdr =
XML_INPUT_FACTORY.createXMLStreamReader(path, fis);
//advance to first start element.
while(!rdr.isStartElement()) {
rdr.next();
}
time = System.currentTimeMillis();
vsr.init(rdr, true, null, sLoader, options, errors);
while (vsr.hasNext()) {
vsr.next();
}
time = (System.currentTimeMillis() - time);
vsr.close();
fis.close();
}
catch (XMLStreamException xse) {
final Location loc = xse.getLocation();
XmlError e = XmlError.forLocation(xse.getMessage(), path,