You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by hi...@apache.org on 2001/03/08 19:17:46 UTC
cvs commit: xml-batik/sources/org/apache/batik/apps/regsvggen Main.java
hillion 01/03/08 10:17:44
Modified: sources/org/apache/batik/apps/regsvggen Main.java
Log:
Removed explicit references to crimson.
Revision Changes Path
1.10 +28 -14 xml-batik/sources/org/apache/batik/apps/regsvggen/Main.java
Index: Main.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/apps/regsvggen/Main.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- Main.java 2001/02/03 16:26:05 1.9
+++ Main.java 2001/03/08 18:17:33 1.10
@@ -42,6 +42,8 @@
import org.apache.batik.transcoder.TranscoderOutput;
import org.apache.batik.transcoder.image.ImageTranscoder;
import org.apache.batik.transcoder.image.PNGTranscoder;
+import org.apache.batik.dom.GenericDOMImplementation;
+import org.apache.batik.dom.util.SAXDocumentFactory;
import org.apache.batik.ext.awt.image.ImageLoader;
import org.apache.batik.ext.awt.image.GraphicsUtil;
import org.apache.batik.svggen.*;
@@ -49,9 +51,6 @@
import org.apache.batik.css.CSSDocumentHandler;
import org.apache.batik.dom.svg.SVGDOMImplementation;
-import org.apache.crimson.tree.*;
-import org.apache.crimson.parser.*;
-
import org.xml.sax.InputSource;
import org.w3c.dom.*;
@@ -61,7 +60,7 @@
* A regression checking tool for SVG generator test cases.
*
* @author <a href="mailto:spei@cs.uiowa.edu">Sheng Pei</a>
- * @version $Id: Main.java,v 1.9 2001/02/03 16:26:05 deweese Exp $
+ * @version $Id: Main.java,v 1.10 2001/03/08 18:17:33 hillion Exp $
*/
public class Main {
@@ -135,7 +134,7 @@
* The CSS parser class name key.
*/
public final static String CSS_PARSER_CLASS_NAME =
- "org.w3c.flute.parser.Parser";
+ "org.apache.batik.css.parser.Parser";
/**
* MAIN
@@ -277,6 +276,21 @@
}
}
}
+
+ /**
+ * The gui resources file name
+ */
+ public final static String RESOURCES =
+ "org.apache.batik.apps.regsvggen.resources.Messages";
+
+ /**
+ * The resource bundle
+ */
+ protected static ResourceBundle bundle;
+ static {
+ bundle = ResourceBundle.getBundle(RESOURCES, Locale.getDefault());
+ }
+
/**
* This method will do the following:
* 1. Load the test case XML file specified by testFileName
@@ -286,23 +300,23 @@
public static String compileTestClass(String testFileName)
throws Exception{
//
- // Load xml test file, using crimson
+ // Load xml test file
//
- XMLReaderImpl parser = new XMLReaderImpl();
- XmlDocumentBuilder builder = new XmlDocumentBuilder();
- parser.setContentHandler(builder);
+ SAXDocumentFactory df = new SAXDocumentFactory
+ (GenericDOMImplementation.getDOMImplementation(),
+ bundle.getString("org.xml.sax.driver"));
+ Document testDoc = null;
try {
- FileReader xmlReader = new FileReader(testFileName);
- InputSource is = new InputSource(xmlReader);
- parser.parse(is);
+ testDoc = df.createDocument(null, "text",
+ new File(testFileName).toURL().toString());
}
catch (Exception e){
+ e.printStackTrace();
display("Error: " + e.toString());
+ throw e;
}
- // Get document DOM
- Document testDoc = builder.getDocument();
//
// Get Test Title
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org