Hi,

the following patch replaces the ancient SAX 1 drivers with SAX 2
drivers.

Use within applets is no reason for keeping SAX 1, IMO. I have
successfully used the (relatively small) Crimson parser for years.
Besides, if anyone exists, it should be no problem to update MinML to
support at least the ContentHandler and ErrorHandler interfaces from SAX
2. (None else are required.)


Jochen

Index: XmlRpc.java
===================================================================
RCS file: /home/cvspublic/ws-xmlrpc/src/java/org/apache/xmlrpc/XmlRpc.java,v
retrieving revision 1.35
diff -u -r1.35 XmlRpc.java
--- XmlRpc.java	21 Nov 2002 01:28:16 -0000	1.35
+++ XmlRpc.java	16 Jun 2004 07:44:26 -0000
@@ -59,13 +59,12 @@
 import java.util.Hashtable;
 import java.util.Stack;
 import java.util.Vector;
-import org.xml.sax.AttributeList;
-import org.xml.sax.HandlerBase;
+
+import org.xml.sax.Attributes;
 import org.xml.sax.InputSource;
-import org.xml.sax.Parser;
 import org.xml.sax.SAXException;
 import org.xml.sax.SAXParseException;
-import uk.co.wilson.xml.MinML;
+
 
 /**
  * This abstract base class provides basic capabilities for XML-RPC,
@@ -84,7 +83,7 @@
  * @author <a href="mailto:[EMAIL PROTECTED]">Andrew Evers</a>
  * @version $Id: XmlRpc.java,v 1.35 2002/11/21 01:28:16 dlr Exp $
  */
-public abstract class XmlRpc extends HandlerBase
+public abstract class XmlRpc extends AbstractXmlRpc
 {
     /**
      * The version string used in HTTP communication.
@@ -93,39 +92,12 @@
     public static final String version = "Apache XML-RPC 1.2-a3-dev";
 
     /**
-     * The default parser to use (MinML).
-     */
-    private static final String DEFAULT_PARSER = MinML.class.getName();
-
-    /**
      * The maximum number of threads which can be used concurrently.
      */
     private static int maxThreads = 100;
 
     String methodName;
 
-    /**
-     * The class name of SAX parser to use.
-     */
-    private static Class parserClass;
-    private static Hashtable saxDrivers = new Hashtable (8);
-
-    static
-    {
-        // A mapping of short identifiers to the fully qualified class
-        // names of common SAX parsers.  If more mappings are added
-        // here, increase the size of the saxDrivers Map used to store
-        // them.
-        saxDrivers.put("xerces", "org.apache.xerces.parsers.SAXParser");
-        saxDrivers.put("xp", "com.jclark.xml.sax.Driver");
-        saxDrivers.put("ibm1", "com.ibm.xml.parser.SAXDriver");
-        saxDrivers.put("ibm2", "com.ibm.xml.parsers.SAXParser");
-        saxDrivers.put("aelfred", "com.microstar.xml.SAXDriver");
-        saxDrivers.put("oracle1", "oracle.xml.parser.XMLParser");
-        saxDrivers.put("oracle2", "oracle.xml.parser.v2.SAXParser");
-        saxDrivers.put("openxml", "org.openxml.parser.XMLSAXParser");
-    }
-
     // the stack we're parsing our values into.
     Stack values;
     Value currentValue;
@@ -257,46 +229,6 @@
     }
 
     /**
-     * Set the SAX Parser to be used. The argument can either be the
-     * full class name or a user friendly shortcut if the parser is
-     * known to this class. The parsers that can currently be set by
-     * shortcut are listed in the main documentation page. If you are
-     * using another parser please send me the name of the SAX driver
-     * and I'll include it in a future release.  If setDriver() is
-     * never called then the System property "sax.driver" is
-     * consulted. If that is not defined the driver defaults to
-     * OpenXML.
-     */
-    public static void setDriver(String driver) throws ClassNotFoundException
-    {
-        String parserClassName = null;
-        try
-        {
-            parserClassName = (String) saxDrivers.get(driver);
-            if (parserClassName == null)
-            {
-                // Identifier lookup failed, assuming we were provided
-                // with the fully qualified class name.
-                parserClassName = driver;
-            }
-            parserClass = Class.forName(parserClassName);
-        }
-        catch (ClassNotFoundException x)
-        {
-            throw new ClassNotFoundException ("SAX driver not found: "
-                    + parserClassName);
-        }
-    }
-
-    /**
-     * Set the SAX Parser to be used by directly passing the Class object.
-     */
-    public static void setDriver(Class driver)
-    {
-        parserClass = driver;
-    }
-
-    /**
      * Set the encoding of the XML.
      *
      * @param enc The Java name of the encoding.
@@ -379,44 +311,13 @@
         currentValue = null;
 
         long now = System.currentTimeMillis();
-        if (parserClass == null)
-        {
-            // try to get the name of the SAX driver from the System properties
-            String driver;
-            try
-            {
-                driver = System.getProperty("sax.driver", DEFAULT_PARSER);
-            }
-            catch (SecurityException e)
-            {
-                // An unsigned applet may not access system properties.
-                driver = DEFAULT_PARSER;
-            }
-            setDriver(driver);
-        }
-
-        Parser parser = null;
-        try
-        {
-            parser = (Parser) parserClass.newInstance();
-        }
-        catch (NoSuchMethodError nsm)
-        {
-            // This is thrown if no constructor exists for the parser class
-            // and is transformed into a regular exception.
-            throw new Exception("Can't create Parser: " + parserClass);
-        }
-
-        parser.setDocumentHandler(this);
-        parser.setErrorHandler(this);
-
         if (debug)
         {
             System.out.println("Beginning parsing XML input stream");
         }
         try
         {
-            parser.parse(new InputSource (is));
+        	newXMLReader().parse(new InputSource (is));
         }
         finally
         {
@@ -461,138 +362,142 @@
     /**
      * Method called by SAX driver.
      */
-    public void endElement(String name) throws SAXException
+    public void endElement(String namespaceURI, String localName, String qName) throws SAXException
     {
 
         if (debug)
         {
-            System.out.println("endElement: " + name);
+            System.out.println("endElement: " + qName);
         }
 
-        // finalize character data, if appropriate
-        if (currentValue != null && readCdata)
-        {
-            currentValue.characterData(cdata.toString());
-            cdata.setLength(0);
-            readCdata = false;
-        }
-
-        if ("value".equals(name))
-        {
-            // Only handle top level objects or objects contained in
-            // arrays here.  For objects contained in structs, wait
-            // for </member> (see code below).
-            int depth = values.size ();
-            if (depth < 2 || values.elementAt(depth - 2).hashCode() != STRUCT)
-            {
-                Value v = currentValue;
-                values.pop();
-                if (depth < 2)
-                {
-                    // This is a top-level object
-                    objectParsed(v.value);
-                    currentValue = null;
-                }
-                else
-                {
-                    // Add object to sub-array; if current container
-                    // is a struct, add later (at </member>).
-                    currentValue = (Value) values.peek();
-                    currentValue.endElement(v);
-                }
-            }
-        }
-
-        // Handle objects contained in structs.
-        if ("member".equals(name))
-        {
-            Value v = currentValue;
-            values.pop();
-            currentValue = (Value) values.peek();
-            currentValue.endElement(v);
-        }
-
-        else if ("methodName".equals(name))
-        {
-            methodName = cdata.toString();
-            cdata.setLength(0);
-            readCdata = false;
+        if (namespaceURI == null  ||  namespaceURI.length() == 0) {
+        	// finalize character data, if appropriate
+        	if (currentValue != null && readCdata)
+        	{
+        		currentValue.characterData(cdata.toString());
+        		cdata.setLength(0);
+        		readCdata = false;
+        	}
+        	
+        	if ("value".equals(localName))
+        	{
+        		// Only handle top level objects or objects contained in
+        		// arrays here.  For objects contained in structs, wait
+        		// for </member> (see code below).
+        		int depth = values.size ();
+        		if (depth < 2 || values.elementAt(depth - 2).hashCode() != STRUCT)
+        		{
+        			Value v = currentValue;
+        			values.pop();
+        			if (depth < 2)
+        			{
+        				// This is a top-level object
+        				objectParsed(v.value);
+        				currentValue = null;
+        			}
+        			else
+        			{
+        				// Add object to sub-array; if current container
+        				// is a struct, add later (at </member>).
+        				currentValue = (Value) values.peek();
+        				currentValue.endElement(v);
+        			}
+        		}
+        	}
+        	
+        	// Handle objects contained in structs.
+        	if ("member".equals(localName))
+        	{
+        		Value v = currentValue;
+        		values.pop();
+        		currentValue = (Value) values.peek();
+        		currentValue.endElement(v);
+        	}
+        	
+        	else if ("methodName".equals(localName))
+        	{
+        		methodName = cdata.toString();
+        		cdata.setLength(0);
+        		readCdata = false;
+        	}
         }
     }
 
     /**
      * Method called by SAX driver.
      */
-    public void startElement(String name, AttributeList atts)
+    public void startElement(String namespaceURI, String localName, String qName, Attributes atts)
             throws SAXException
     {
         if (debug)
         {
-            System.out.println("startElement: " + name);
+            System.out.println("startElement: " + qName);
         }
 
-        if ("value".equals(name))
-        {
-            Value v = new Value();
-            values.push(v);
-            currentValue = v;
-            // cdata object is reused
-            cdata.setLength(0);
-            readCdata = true;
-        }
-        else if ("methodName".equals(name))
-        {
-            cdata.setLength(0);
-            readCdata = true;
-        }
-        else if ("name".equals(name))
-        {
-            cdata.setLength(0);
-            readCdata = true;
-        }
-        else if ("string".equals(name))
-        {
-            // currentValue.setType (STRING);
-            cdata.setLength(0);
-            readCdata = true;
-        }
-        else if ("i4".equals(name) || "int".equals(name))
-        {
-            currentValue.setType(INTEGER);
-            cdata.setLength(0);
-            readCdata = true;
-        }
-        else if ("boolean".equals(name))
-        {
-            currentValue.setType(BOOLEAN);
-            cdata.setLength(0);
-            readCdata = true;
-        }
-        else if ("double".equals(name))
-        {
-            currentValue.setType(DOUBLE);
-            cdata.setLength(0);
-            readCdata = true;
-        }
-        else if ("dateTime.iso8601".equals(name))
-        {
-            currentValue.setType(DATE);
-            cdata.setLength(0);
-            readCdata = true;
-        }
-        else if ("base64".equals(name))
-        {
-            currentValue.setType(BASE64);
-            cdata.setLength(0);
-            readCdata = true;
-        }
-        else if ("struct".equals(name))
-        {
-            currentValue.setType(STRUCT);
-        }
-        else if ("array".equals(name))
-        {
-            currentValue.setType(ARRAY);
+        if (namespaceURI == null  ||  namespaceURI.length() == 0) {
+            if ("value".equals(localName))
+        	{
+        		Value v = new Value();
+        		values.push(v);
+        		currentValue = v;
+        		// cdata object is reused
+        		cdata.setLength(0);
+        		readCdata = true;
+        	}
+        	else if ("methodName".equals(localName))
+        	{
+        		cdata.setLength(0);
+        		readCdata = true;
+        	}
+        	else if ("name".equals(localName))
+        	{
+        		cdata.setLength(0);
+        		readCdata = true;
+        	}
+        	else if ("string".equals(localName))
+        	{
+        		// currentValue.setType (STRING);
+        		cdata.setLength(0);
+        		readCdata = true;
+        	}
+        	else if ("i4".equals(localName) || "int".equals(localName))
+        	{
+        		currentValue.setType(INTEGER);
+        		cdata.setLength(0);
+        		readCdata = true;
+        	}
+        	else if ("boolean".equals(localName))
+        	{
+        		currentValue.setType(BOOLEAN);
+        		cdata.setLength(0);
+        		readCdata = true;
+        	}
+        	else if ("double".equals(localName))
+        	{
+        		currentValue.setType(DOUBLE);
+        		cdata.setLength(0);
+        		readCdata = true;
+        	}
+        	else if ("dateTime.iso8601".equals(localName))
+        	{
+        		currentValue.setType(DATE);
+        		cdata.setLength(0);
+        		readCdata = true;
+        	}
+        	else if ("base64".equals(localName))
+        	{
+        		currentValue.setType(BASE64);
+        		cdata.setLength(0);
+        		readCdata = true;
+        	}
+        	else if ("struct".equals(localName))
+        	{
+        		currentValue.setType(STRUCT);
+        	}
+        	else if ("array".equals(localName))
+        	{
+        		currentValue.setType(ARRAY);
+        	}
         }
     }
 
Index: XmlRpcClientResponseProcessor.java
===================================================================
RCS file: /home/cvspublic/ws-xmlrpc/src/java/org/apache/xmlrpc/XmlRpcClientResponseProcessor.java,v
retrieving revision 1.1
diff -u -r1.1 XmlRpcClientResponseProcessor.java
--- XmlRpcClientResponseProcessor.java	5 Dec 2002 08:49:24 -0000	1.1
+++ XmlRpcClientResponseProcessor.java	16 Jun 2004 07:44:26 -0000
@@ -59,7 +59,10 @@
 import java.io.InputStream;
 
 import org.xml.sax.AttributeList;
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
 import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
 
 /**
  * Process an XML-RPC server response from a byte array or an
@@ -149,16 +152,16 @@
     /**
      * Overrides method in XmlRpc to handle fault repsonses.
      */
-    public void startElement(String name, AttributeList atts)
+    public void startElement(String namespaceURI, String localName, String qName, Attributes atts)
             throws SAXException
     {
-        if ("fault".equals(name))
+        if ("fault".equals(localName))
         {
             fault = true;
         }
         else
         {
-            super.startElement(name, atts);
+            super.startElement(namespaceURI, localName, qName, atts);
         }
     }
 
Index: applet/SimpleXmlRpcClient.java
===================================================================
RCS file: /home/cvspublic/ws-xmlrpc/src/java/org/apache/xmlrpc/applet/SimpleXmlRpcClient.java,v
retrieving revision 1.8
diff -u -r1.8 SimpleXmlRpcClient.java
--- applet/SimpleXmlRpcClient.java	14 May 2004 15:47:05 -0000	1.8
+++ applet/SimpleXmlRpcClient.java	16 Jun 2004 07:44:26 -0000
@@ -71,15 +71,16 @@
 import java.util.Hashtable;
 import java.util.Stack;
 import java.util.Vector;
+
 import org.apache.commons.codec.binary.Base64;
 import org.apache.commons.codec.DecoderException;
 import org.apache.commons.codec.EncoderException;
-import org.xml.sax.AttributeList;
-import org.xml.sax.HandlerBase;
+import org.apache.xmlrpc.AbstractXmlRpc;
+import org.xml.sax.Attributes;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 import org.xml.sax.SAXParseException;
-import uk.co.wilson.xml.MinML;
+
 
 /**
  * A simple XML-RPC client.
@@ -135,7 +136,7 @@
 /**
  * FIXME: Leverage the XmlRpc class.
  */
-class XmlRpcSupport extends HandlerBase
+class XmlRpcSupport extends AbstractXmlRpc
 {
 
     URL url;
@@ -198,12 +199,7 @@
     {
         values = new Stack();
         long now = System.currentTimeMillis();
-        MinML parser = new MinML();
-        parser.setDocumentHandler(this);
-        parser.setErrorHandler(this);
-
-        parser.parse(new InputSource(is));
-
+        newXMLReader().parse(new InputSource(is));
         if (debug)
         {
             System.out.println("Spent " + (System.currentTimeMillis() - now)
@@ -407,136 +403,140 @@
     /**
      * Method called by SAX driver.
      */
-    public void endElement(String name) throws SAXException
+    public void endElement(String namespaceURI, String localName, String qName) throws SAXException
     {
         if (debug)
         {
-            System.err.println("endElement: " + name);
-        }
-
-        // finalize character data, if appropriate
-        if (currentValue != null && readCdata)
-        {
-            currentValue.characterData(cdata.toString());
-            cdata.setLength(0);
-            readCdata = false;
+            System.err.println("endElement: " + qName);
         }
 
-        if ("value".equals(name))
-        {
-            int depth = values.size();
-            // Only handle top level objects or objects contained in arrays here.
-            // For objects contained in structs, wait for </member> (see code below).
-            if (depth < 2 || values.elementAt (depth - 2).hashCode () != STRUCT)
-            {
-                Value v = currentValue;
-                values.pop();
-                if (depth < 2)
-                {
-                    // This is a top-level object
-                    objectParsed(v.value);
-                    currentValue = null;
-                }
-                else
-                {
-                    // add object to sub-array; if current container is a struct, add later (at </member>)
-                    currentValue = (Value) values.peek();
-                    currentValue.endElement(v);
-                }
-            }
-        }
-
-        // Handle objects contained in structs.
-        if ("member".equals(name))
-        {
-            Value v = currentValue;
-            values.pop();
-            currentValue = (Value) values.peek();
-            currentValue.endElement(v);
-        }
-
-        else if ("methodName".equals(name))
-        {
-            methodName = cdata.toString();
-            cdata.setLength(0);
-            readCdata = false;
+        if (namespaceURI == null  ||  namespaceURI.length() == 0) {
+        	// finalize character data, if appropriate
+        	if (currentValue != null && readCdata)
+        	{
+        		currentValue.characterData(cdata.toString());
+        		cdata.setLength(0);
+        		readCdata = false;
+        	}
+        	
+        	if ("value".equals(localName))
+        	{
+        		int depth = values.size();
+        		// Only handle top level objects or objects contained in arrays here.
+        		// For objects contained in structs, wait for </member> (see code below).
+        		if (depth < 2 || values.elementAt (depth - 2).hashCode () != STRUCT)
+        		{
+        			Value v = currentValue;
+        			values.pop();
+        			if (depth < 2)
+        			{
+        				// This is a top-level object
+        				objectParsed(v.value);
+        				currentValue = null;
+        			}
+        			else
+        			{
+        				// add object to sub-array; if current container is a struct, add later (at </member>)
+        				currentValue = (Value) values.peek();
+        				currentValue.endElement(v);
+        			}
+        		}
+        	}
+        	
+        	// Handle objects contained in structs.
+        	if ("member".equals(localName))
+        	{
+        		Value v = currentValue;
+        		values.pop();
+        		currentValue = (Value) values.peek();
+        		currentValue.endElement(v);
+        	}
+        	
+        	else if ("methodName".equals(localName))
+        	{
+        		methodName = cdata.toString();
+        		cdata.setLength(0);
+        		readCdata = false;
+        	}
         }
     }
 
     /**
      * Method called by SAX driver.
      */
-    public void startElement (String name, AttributeList atts)
+    public void startElement (String namespaceURI, String localName, String qName, Attributes atts)
             throws SAXException
     {
         if (debug)
         {
-            System.err.println("startElement: " + name);
+            System.err.println("startElement: " + qName);
         }
 
-        if ("value".equals(name))
-        {
-            // System.err.println ("starting value");
-            Value v = new Value();
-            values.push(v);
-            currentValue = v;
-            // cdata object is reused
-            cdata.setLength(0);
-            readCdata = true;
-        }
-        else if ("methodName".equals(name))
-        {
-            cdata.setLength(0);
-            readCdata = true;
-        }
-        else if ("name".equals(name))
-        {
-            cdata.setLength(0);
-            readCdata = true;
-        }
-        else if ("string".equals(name))
-        {
-            // currentValue.setType (STRING);
-            cdata.setLength(0);
-            readCdata = true;
-        }
-        else if ("i4".equals(name) || "int".equals(name))
-        {
-            currentValue.setType(INTEGER);
-            cdata.setLength(0);
-            readCdata = true;
-        }
-        else if ("boolean".equals(name))
-        {
-            currentValue.setType(BOOLEAN);
-            cdata.setLength(0);
-            readCdata = true;
-        }
-        else if ("double".equals(name))
-        {
-            currentValue.setType(DOUBLE);
-            cdata.setLength(0);
-            readCdata = true;
-        }
-        else if ("dateTime.iso8601".equals(name))
-        {
-            currentValue.setType(DATE);
-            cdata.setLength(0);
-            readCdata = true;
-        }
-        else if ("base64".equals(name))
-        {
-            currentValue.setType(BASE64);
-            cdata.setLength(0);
-            readCdata = true;
-        }
-        else if ("struct".equals(name))
-        {
-            currentValue.setType(STRUCT);
-        }
-        else if ("array".equals(name))
-        {
-            currentValue.setType(ARRAY);
+        if (namespaceURI == null  ||  namespaceURI.length() == 0) {
+        	if ("value".equals(localName))
+        	{
+        		// System.err.println ("starting value");
+        		Value v = new Value();
+        		values.push(v);
+        		currentValue = v;
+        		// cdata object is reused
+        		cdata.setLength(0);
+        		readCdata = true;
+        	}
+        	else if ("methodName".equals(localName))
+        	{
+        		cdata.setLength(0);
+        		readCdata = true;
+        	}
+        	else if ("name".equals(localName))
+        	{
+        		cdata.setLength(0);
+        		readCdata = true;
+        	}
+        	else if ("string".equals(localName))
+        	{
+        		// currentValue.setType (STRING);
+        		cdata.setLength(0);
+        		readCdata = true;
+        	}
+        	else if ("i4".equals(localName) || "int".equals(localName))
+        	{
+        		currentValue.setType(INTEGER);
+        		cdata.setLength(0);
+        		readCdata = true;
+        	}
+        	else if ("boolean".equals(localName))
+        	{
+        		currentValue.setType(BOOLEAN);
+        		cdata.setLength(0);
+        		readCdata = true;
+        	}
+        	else if ("double".equals(localName))
+        	{
+        		currentValue.setType(DOUBLE);
+        		cdata.setLength(0);
+        		readCdata = true;
+        	}
+        	else if ("dateTime.iso8601".equals(localName))
+        	{
+        		currentValue.setType(DATE);
+        		cdata.setLength(0);
+        		readCdata = true;
+        	}
+        	else if ("base64".equals(localName))
+        	{
+        		currentValue.setType(BASE64);
+        		cdata.setLength(0);
+        		readCdata = true;
+        	}
+        	else if ("struct".equals(localName))
+        	{
+        		currentValue.setType(STRUCT);
+        	}
+        	else if ("array".equals(localName))
+        	{
+        		currentValue.setType(ARRAY);
+        	}
         }
     }
 
Index: AbstractXmlRpc.java
===================================================================
RCS file: AbstractXmlRpc.java
diff -N AbstractXmlRpc.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ AbstractXmlRpc.java	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,52 @@
+package org.apache.xmlrpc;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.xml.sax.ContentHandler;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.XMLReader;
+
+
+public abstract class AbstractXmlRpc implements ErrorHandler, ContentHandler {
+    /** For use by subclasses, accessible via [EMAIL PROTECTED] #getDocumentLocator()}.
+     */
+    private Locator locator;
+
+    protected XMLReader newXMLReader() throws SAXException, ParserConfigurationException {
+        SAXParserFactory spf = SAXParserFactory.newInstance();
+        spf.setNamespaceAware(true);
+        spf.setValidating(false);
+        XMLReader xr = spf.newSAXParser().getXMLReader();
+        xr.setContentHandler(this);
+        xr.setErrorHandler(this);
+        return xr;
+    }
+
+	public void setDocumentLocator(Locator pLocator) {
+	    locator = pLocator;
+	}
+
+	public Locator getDocumentLocator() {
+		return locator;
+	}
+
+	public void warning(SAXParseException pException) throws SAXException {}
+
+	public void endDocument() throws SAXException {}
+
+	public void startDocument() throws SAXException {}
+
+	public void ignorableWhitespace(char[] pCh, int pStart, int pLength) throws SAXException {}
+
+	public void endPrefixMapping(String prefix) throws SAXException {}
+
+	public void skippedEntity(String pName) throws SAXException {}
+
+	public void processingInstruction(String pTarget, String pData) throws SAXException {}
+
+	public void startPrefixMapping(String prefix, String pUri) throws SAXException {}
+}
Index: AsyncBenchmark.java
===================================================================
RCS file: /home/cvspublic/ws-xmlrpc/src/test/org/apache/xmlrpc/AsyncBenchmark.java,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 AsyncBenchmark.java
--- AsyncBenchmark.java	20 Jul 2001 19:38:20 -0000	1.1.1.1
+++ AsyncBenchmark.java	16 Jun 2004 07:43:49 -0000
@@ -56,9 +56,11 @@
  */
 
 import java.util.*;
-import java.io.IOException;
 import java.net.URL;
 
+import javax.xml.parsers.SAXParserFactory;
+
+
 public class AsyncBenchmark 
     implements Runnable
 {
@@ -118,12 +120,12 @@
             url = args[0];
             XmlRpc.setKeepAlive (true);
             if (args.length == 2)
-                XmlRpc.setDriver (args[1]);
+                System.setProperty(SAXParserFactory.class.getName(), args[1]);
             new AsyncBenchmark ();
         }
         else
         {
-            System.err.println ("Usage: java org.apache.xmlrpc.Benchmark URL [SAXDriver]");
+            System.err.println ("Usage: java org.apache.xmlrpc.Benchmark URL [SAXParserFactory]");
         }
     }
 
Index: Benchmark.java
===================================================================
RCS file: /home/cvspublic/ws-xmlrpc/src/test/org/apache/xmlrpc/Benchmark.java,v
retrieving revision 1.2
diff -u -r1.2 Benchmark.java
--- Benchmark.java	14 Nov 2001 15:12:01 -0000	1.2
+++ Benchmark.java	16 Jun 2004 07:43:49 -0000
@@ -58,6 +58,8 @@
 import java.util.*;
 import java.io.IOException;
 
+import javax.xml.parsers.SAXParserFactory;
+
 public class Benchmark
     implements Runnable
 {
@@ -170,12 +172,12 @@
             url = args[0];
             XmlRpc.setKeepAlive (true);
             if (args.length == 2)
-                XmlRpc.setDriver (args[1]);
+                System.setProperty (SAXParserFactory.class.getName(), args[1]);
             new Benchmark ();
         }
         else
         {
-            System.err.println ("Usage: java org.apache.xmlrpc.Benchmark URL [SAXDriver]");
+            System.err.println ("Usage: java org.apache.xmlrpc.Benchmark URL [SAXParserFactory]");
         }
     }
 
Index: ClientServerRpcTest.java
===================================================================
RCS file: /home/cvspublic/ws-xmlrpc/src/test/org/apache/xmlrpc/ClientServerRpcTest.java,v
retrieving revision 1.15
diff -u -r1.15 ClientServerRpcTest.java
--- ClientServerRpcTest.java	21 May 2003 16:06:03 -0000	1.15
+++ ClientServerRpcTest.java	16 Jun 2004 07:43:49 -0000
@@ -78,15 +78,6 @@
     extends LocalServerRpcTest
 {
     /**
-     * The identifier or fully qualified class name of the SAX driver
-     * to use.  This is generally <code>uk.co.wilson.xml.MinML</code>,
-     * but could be changed to
-     * <code>org.apache.xerces.parsers.SAXParser</code> for timing
-     * comparisons.
-     */
-    private static final String SAX_DRIVER = "uk.co.wilson.xml.MinML";
-
-    /**
      * The number of RPCs to make for each test.
      */
     private static final int NBR_REQUESTS = 1000;
@@ -110,15 +101,6 @@
         super(testName);
 
         XmlRpc.setDebug(true);
-        try
-        {
-            XmlRpc.setDriver(SAX_DRIVER);
-        }
-        catch (ClassNotFoundException e)
-        {
-            fail(e.toString());
-        }
-
         // Server (only)
         server = new XmlRpcServer();
         server.addHandler(HANDLER_NAME, new TestHandler());

Reply via email to