diff --git a/core/src/net/sf/openrocket/file/simplesax/SimpleSAX.java b/core/src/net/sf/openrocket/file/simplesax/SimpleSAX.java index 2053d42e2..cc1fc55f6 100644 --- a/core/src/net/sf/openrocket/file/simplesax/SimpleSAX.java +++ b/core/src/net/sf/openrocket/file/simplesax/SimpleSAX.java @@ -11,6 +11,9 @@ import org.xml.sax.SAXException; import org.xml.sax.XMLReader; import org.xml.sax.helpers.XMLReaderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; /** * A "simple SAX" XML reader. This system imposes the limit that an XML element may @@ -18,27 +21,26 @@ import org.xml.sax.helpers.XMLReaderFactory; * both. This holds true for both the OpenRocket and RockSim design formats and the * RockSim engine definition format. *
- * The actual handling is performed by subclasses of {@link ElementHandler}. The
+ * The actual handling is performed by subclasses of {@link ElementHandler}. The
* initial handler is provided to the {@link #readXML(InputSource, ElementHandler, WarningSet)}
* method.
- *
+ *
* @author Sampo Niskanen null
).
* @throws IOException if an I/O exception occurs while reading.
* @throws SAXException if e.g. malformed XML is encountered.
*/
- public static void readXML(InputSource source, ElementHandler initialHandler,
- WarningSet warnings) throws IOException, SAXException {
+ public static void readXML(InputSource source, ElementHandler initialHandler, WarningSet warnings)
+ throws IOException, SAXException {
DelegatorHandler xmlhandler = new DelegatorHandler(initialHandler, warnings);
@@ -55,17 +57,27 @@ public class SimpleSAX {
}
private static class XMLReaderCache {
+ private final SAXParserFactory parserFactory;
private final BlockingQueue