+ }
+
+
+ /**
+ * Try both Xerces and the built-in java classes to parse the given xml stream
+ * @param inStream input stream from file / zip / gzip
+ * @return true on success, false if both xerces and built-in parser failed
+ */
+ public boolean parseXmlStream(InputStream inStream)
+ {
+ boolean success = false;
+ // Firstly, try to use xerces to parse the xml (will throw an exception if not available)
+ try
+ {
+ XMLReader xmlReader = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
+ xmlReader.setContentHandler(this);
+ xmlReader.parse(new InputSource(inStream));
+ success = true; // worked
+ }
+ catch (Exception e) {} // don't care too much if it didn't work, there's a backup
+
+ // If that didn't work, try the built-in classes (which work for xml1.0 but handling for 1.1 contains bugs)
+ if (!success)