xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sam Ruby" <ru...@us.ibm.com>
Subject Pluggable components ( was: Volunteers: First Cut)
Date Tue, 06 Mar 2001 20:28:26 GMT
Stephane Hillion wrote:
>
> Sorry to reference crimson in testing tools ;)

I didn't realize that it was a testing tool.  In any case, it looks easy to
fix.  Quick attempt at a patch below.  Hopefully someone here will help you
find a satisfactory way to resolve the runtime references.

Binding directly to the Xalan 1 interfaces is also a concern.  The TraX
interfaces in JAXP should let you become XSLT processor independent.

I'd also was wondering if you would consider replacing
org.apache.batik.script with
http://oss.software.ibm.com/developerworks/projects/bsf ?

- Sam Ruby

--- Main.java   2001/02/03 16:26:05     1.9
+++ Main.java   2001/03/06 20:15:56
@@ -49,8 +49,10 @@
 import org.apache.batik.css.CSSDocumentHandler;
 import org.apache.batik.dom.svg.SVGDOMImplementation;

-import org.apache.crimson.tree.*;
-import org.apache.crimson.parser.*;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.DocumentBuilder;

 import org.xml.sax.InputSource;

@@ -286,23 +288,21 @@
     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);
+        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        DocumentBuilder builder = factory.newDocumentBuilder();
+        Document testDoc;

         try {
-            FileReader xmlReader = new FileReader(testFileName);
-            InputSource is = new InputSource(xmlReader);
-            parser.parse(is);
+            testDoc = builder.parse(testFileName);
         }
         catch (Exception e){
             display("Error: " + e.toString());
+            throw e;
         }
         // Get document DOM
-        Document testDoc = builder.getDocument();

         //
         // Get Test Title


Mime
View raw message