/* 160 */ if (xmlfile == null) {
/* 161 */ System.out.println("Usage: org.apache.xml.resolver.apps.xread [opts] xmlfile");
/* 162 */ System.exit(1);
/* */ }
/* */
/* 165 */ ResolvingXMLReader reader = new ResolvingXMLReader();
/* */ try
/* */ {
/* 168 */ reader.setFeature("http://xml.org/sax/features/namespaces", nsAware);
/* 169 */ reader.setFeature("http://xml.org/sax/features/validation", validating);
/* 170 */ if (useSchema) {
/* 171 */ reader.setFeature("http://apache.org/xml/features/validation/schema", true);
/* */ }
/* */ }
/* */ catch (SAXException e)
/* */ {
/* */ }
/* 177 */ Catalog catalog = reader.getCatalog();
/* */
/* 179 */ for (int count = 0; count < catalogFiles.size(); count++) {
/* 180 */ String file = (String)catalogFiles.elementAt(count);
/* 181 */ catalog.parseCatalog(file);
/* */ }
/* */
/* 184 */ XParseError xpe = new XParseError(showErrors, showWarnings);
/* 185 */ xpe.setMaxMessages(maxErrs);
/* 186 */ reader.setErrorHandler(xpe);
/* */
/* 188 */ String parseType = validating ? "validating" : "well-formed";
/* 189 */ String nsType = nsAware ? "namespace-aware" : "namespace-ignorant";
/* 190 */ if (maxErrs > 0) {
/* 191 */ System.out.println("Attempting " + parseType + ", " + nsType + " parse");
/* */ }
/* */
/* 198 */ Date startTime = new Date();
/* */ try
/* */ {
/* 201 */ reader.parse(xmlfile);
/* */ } catch (SAXException sx) {
/* 203 */ System.out.println("SAX Exception: " + sx);
/* */ } catch (Exception e) {
/* 205 */ e.printStackTrace();
/* */ }