You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Timm, Sean" <ST...@mailgo.com> on 2000/10/15 03:35:42 UTC

[PATCH] Update SAXParser and Factory to JAXP 1.1 Public Review sp ec.

I wanted to be able to compile Tomcat 4.0 with just Xerces, so I updated the
JAXP classes on the SAX side to match the new 1.1 spec.  There are still a
few changes to be made, but it suits my purposes.  :)  I have not provided
an implementation that does anything for getProperty or setProperty on the
SAXParserFactory, nor have I handled the two new parse methods for SAXParser
that allow you to pass in a base URI to resolve to (instead it just acts as
if you hadn't passed that in).  Other than that, it should work just fine.
(Just search for TODO to see what I didn't do.)

On a side note, are the javax.xml classes supposed to reside inside each
implementation of JAXP?  The licensing seems a bit unfriendly for that.  At
any rate, I didn't want any sort of legal hassles, so I haven't even
downloaded the JAXP1.1 early access release.

Patch follows:
Index: src/javax/xml/parsers/SAXParser.java
===================================================================
RCS file:
/home/cvspublic/xml-xerces/java/src/javax/xml/parsers/SAXParser.java,v
retrieving revision 1.3
diff -u -r1.3 SAXParser.java
--- src/javax/xml/parsers/SAXParser.java	2000/06/08 23:33:08	1.3
+++ src/javax/xml/parsers/SAXParser.java	2000/10/15 01:26:56
@@ -60,10 +60,14 @@
 import java.io.File;
 import java.io.InputStream;
 import java.io.IOException;
+import org.xml.sax.helpers.DefaultHandler;
 import org.xml.sax.HandlerBase;
 import org.xml.sax.InputSource;
 import org.xml.sax.Parser;
+import org.xml.sax.XMLReader;
 import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotRecognizedException;
+import org.xml.sax.SAXNotSupportedException;
 
 /**
  * Implementation instances of the <code>SAXParser</code> abstract class
@@ -78,13 +82,13 @@
  * <br>
  * <b>ATTENTION:</b> THIS IMPLEMENTATION OF THE "JAVAX.XML.PARSER" CLASSES
  *   IS NOT THE OFFICIAL REFERENCE IMPLEMENTATION OF THE JAVA SPECIFICATION
- *   REQUEST 5 FOUND AT
- *   <a
href="http://java.sun.com/aboutJava/communityprocess/jsr/jsr_005_xml.html">
- *   http://java.sun.com/aboutJava/communityprocess/jsr/jsr_005_xml.html
+ *   REQUEST 63 FOUND AT
+ *   <a
href="http://java.sun.com/aboutJava/communityprocess/jsr/jsr_063_jaxp11.html
">
+ *   http://java.sun.com/aboutJava/communityprocess/jsr/jsr_063_jaxp11.html
  *   </a><br>
- *   THIS IMPLEMENTATION IS CONFORMANT TO THE "JAVA API FOR XML PARSING"
- *   SPECIFICATION VERSION 1.0 PUBLIC RELEASE 1 BY JAMES DUNCAN DAVIDSON
- *   PUBLISHED BY SUN MICROSYSTEMS ON FEB. 18, 2000 AND FOUND AT
+ *   THIS IMPLEMENTATION IS CONFORMANT TO THE "JAVA API FOR XML PROCESSING"
+ *   SPECIFICATION VERSION 1.1 BY JAMES DUNCAN DAVIDSON AND RAJIV MORDANI
+ *   PUBLISHED FOR PUBLIC REVIEW BY SUN MICROSYSTEMS ON OCT. 2, 2000 AND
FOUND AT
  *   <a href="http://java.sun.com/xml">http://java.sun.com/xml</a>
  * <br>
  * <br>
@@ -101,7 +105,7 @@
  *
  * @author <a href="pier@betaversion.org">Pierpaolo Fumagalli</a>
  * @author Copyright &copy; 2000 The Apache Software Foundation.
- * @version 1.0 CVS $Revision: 1.3 $ $Date: 2000/06/08 23:33:08 $
+ * @version 1.1 CVS $Revision: 1.3 $ $Date: 2000/06/08 23:33:08 $
  */
 public abstract class SAXParser {
 
@@ -111,8 +115,8 @@
      * implementation class.
      * <br>
      * Application programmers should not be able to directly construct 
-     * implementation subclasses of this abstract subclass. The only way a 
-     * application should be able to obtain a reference to a SAXParser 
+     * implementation subclasses of this abstract subclass. The only way an

+     * application should be able to obtain a reference to a
<code>SAXParser</code> 
      * implementation instance is by using the appropriate methods of the 
      * <code>SAXParserFactory</code>.
      */
@@ -121,8 +125,35 @@
     }
 
     /**
+     * Allows implementation-specific properties to be set.  This API was
+     * introduced in SAX 2.0 and allows users to configure the underlying
SAX
+     * parser.
+     *
+     * @exception SAXNotRecognizedException If the underlying parser can't
+     *                recognize the option.
+     * @exception SAXNotSupportedException If the underlying parser
recognizes
+     *                but doesn't support the option.
+     */
+    public abstract void setProperty(String name, Object value)
+    throws SAXNotRecognizedException, SAXNotSupportedException;
+
+    /**
+     * Returns the value of the requested property.
+     *
+     * @exception SAXNotRecognizedException If the underlying parser can't
+     *                recognize the option.
+     * @exception SAXNotSupportedException If the underlying parser
recognizes
+     *                but doesn't support the option.
+     */
+    public abstract Object getProperty(String name)
+    throws SAXNotRecognizedException, SAXNotSupportedException;
+
+    /**
      * Parses the contents of the given <code>InputStream</code> as an XML
      * document using the specified <code>HandlerBase</code> object.
+     * <br>
+     * <b>Use of the <code>DefaultHandler</code> version of this method is
+     * recommended.</b>
      *
      * @exception SAXException If there is a problem parsing the given XML
      *                content.
@@ -138,8 +169,33 @@
     }
 
     /**
+     * Parses the contents of the given <code>InputStream</code> as an XML
+     * document using the specified <code>HandlerBase</code> object.  The
+     * systemId provides a base for resolving relative URIs.
+     * <br>
+     * <b>Use of the <code>DefaultHandler</code> version of this method is
+     * recommended.</b>
+     *
+     * @exception SAXException If there is a problem parsing the given XML
+     *                content.
+     * @exception IOException If any IO errors occur reading the given
+     *                <code>InputStream</code>.
+     * @exception  IllegalArgumentException If the given
+     *                <code>InputStream</code> is <b>null</b>.
+     */
+    public void parse(InputStream stream, HandlerBase base, String
systemId)
+    throws SAXException, IOException, IllegalArgumentException {
+        if (stream==null) throw new IllegalArgumentException();
+        // TODO: Add support for systemId passed in...
+        this.parse(new InputSource(stream),base);
+    }
+
+    /**
      * Parses the content of the given URI as an XML document using the
      * specified <code>HandlerBase</code> object.
+     * <br>
+     * <b>Use of the <code>DefaultHandler</code> version of this method is
+     * recommended.</b>
      *
      * @exception SAXException If there is a problem parsing the given XML
      *                content.
@@ -156,6 +212,9 @@
     /**
      * Parses the content of the given <code>File</code> as an XML document
      * using the specified <code>HandlerBase</code> object.
+     * <br>
+     * <b>Use of the <code>DefaultHandler</code> version of this method is
+     * recommended.</b>
      *
      * @exception SAXException If there is a problem parsing the given XML
      *                content.
@@ -184,6 +243,9 @@
     /**
      * Parses the content of the given <code>InputSource</code> as an XML
      * document using the specified <code>HandlerBase</code> object.
+     * <br>
+     * <b>Use of the <code>DefaultHandler</code> version of this method is
+     * recommended.</b>
      *
      * @exception SAXException If there is a problem parsing the given XML
      *                content.
@@ -212,24 +274,145 @@
     }
 
     /**
+     * Parses the contents of the given <code>InputStream</code> as an XML
+     * document using the specified <code>DefaultHandler</code> object.
+     *
+     * @exception SAXException If there is a problem parsing the given XML
+     *                content.
+     * @exception IOException If any IO errors occur reading the given
+     *                <code>InputStream</code>.
+     * @exception  IllegalArgumentException If the given
+     *                <code>InputStream</code> is <b>null</b>.
+     */
+    public void parse(InputStream stream, DefaultHandler dh)
+    throws SAXException, IOException, IllegalArgumentException {
+        if (stream==null) throw new IllegalArgumentException();
+        this.parse(new InputSource(stream),dh);
+    }
+
+    /**
+     * Parses the contents of the given <code>InputStream</code> as an XML
+     * document using the specified <code>DefaultHandler</code> object.
The
+     * systemId provides a base for resolving relative URIs.
+     *
+     * @exception SAXException If there is a problem parsing the given XML
+     *                content.
+     * @exception IOException If any IO errors occur reading the given
+     *                <code>InputStream</code>.
+     * @exception  IllegalArgumentException If the given
+     *                <code>InputStream</code> is <b>null</b>.
+     */
+    public void parse(InputStream stream, DefaultHandler dh, String
systemId)
+    throws SAXException, IOException, IllegalArgumentException {
+        if (stream==null) throw new IllegalArgumentException();
+        // TODO: Add support for systemId passed in...
+        this.parse(new InputSource(stream),dh);
+    }
+
+    /**
+     * Parses the content of the given URI as an XML document using the
+     * specified <code>DefaultHandler</code> object.
+     *
+     * @exception SAXException If there is a problem parsing the given XML
+     *                content.
+     * @exception IOException If any IO errors occur while reading content
+     *                located by the given URI.
+     * @exception IllegalArgumentException If the given URI is <b>null</b>.
+     */
+    public void parse(String uri, DefaultHandler dh)
+    throws SAXException, IOException, IllegalArgumentException {
+        if (uri==null) throw new IllegalArgumentException();
+        this.parse(new InputSource(uri),dh);
+    }
+
+    /**
+     * Parses the content of the given <code>File</code> as an XML document
+     * using the specified <code>DefaultHandler</code> object.
+     *
+     * @exception SAXException If there is a problem parsing the given XML
+     *                content.
+     * @exception IOException if any IO errors occur while reading content
+     *                from the given <code>File</code>.
+     * @exception IllegalArgumentException if the given <code>File</code>
is
+     *                <b>null</b>.
+     */
+    public void parse(File file, DefaultHandler dh)
+    throws SAXException, IOException, IllegalArgumentException {
+        if (file==null) throw new IllegalArgumentException();
+        String path = file.getAbsolutePath();
+        if (File.separatorChar != '/') {
+            path = path.replace(File.separatorChar, '/');
+        }
+        if (!path.startsWith("/")) {
+            path = "/" + path;
+        }
+        if (!path.endsWith("/") && file.isDirectory()) {
+            path = path + "/";
+        }
+        java.net.URL url = new java.net.URL("file", "", path);
+        this.parse(new InputSource(url.toString()),dh);
+    }
+
+    /**
+     * Parses the content of the given <code>InputSource</code> as an XML
+     * document using the specified <code>DefaultHandler</code> object.
+     *
+     * @exception SAXException If there is a problem parsing the given XML
+     *                content.
+     * @exception IOException if any IO Errors occur while reading content
+     *                from the given <code>InputSource</code>.
+     * @exception IllegalArgumentException if the given
+     *                <code>InputSource</code> is <b>null</b>.
+     */
+    public void parse(InputSource source, DefaultHandler dh)
+    throws SAXException, IOException, IllegalArgumentException {
+        if (source==null) throw new IllegalArgumentException();
+
+        // Get the SAX parser instance
+        XMLReader x=this.getXMLReader();
+
+        // Set the various handler instances
+        if (dh!=null) {
+            x.setContentHandler(dh);
+            x.setDTDHandler(dh);
+            x.setEntityResolver(dh);
+            x.setErrorHandler(dh);
+        }
+
+        // Parse the specified source
+        x.parse(source);
+    }
+
+    /**
      * Returns the underlying <code>Parser</code> object which is wrapped
by
      * this <code>SAXParser</code> implementation.
+     * <br>
+     * <b>Use of the getXMLReader method is recommended.</b>
      *
-     * @exception SAXException If the initialization of the underlying
parser
-     *                fails. <b>NOTE:</b> This Exception is specified on
page
-     *                21 of the specification, but later on omissed in this
-     *                method documentation on page 23. Wich one is correct?
+     * @exception SAXException If the underlying parser cannot be obtained
      */
     public abstract Parser getParser()
     throws SAXException;
 
     /**
+     * Returns the underlying <code>XMLReader</code> object which is
wrapped by
+     * this <code>SAXParser</code> implementation.
+     * <br>
+     * <b>Use of the getXMLReader method is recommended.</b>
+     *
+     * @exception SAXException If the underlying reader cannot be obtained
+     */
+    public abstract XMLReader getXMLReader()
+    throws SAXException;
+
+    /**
      * Returns whether or not this parser supports XML namespaces.
      */
     public abstract boolean isNamespaceAware();
 
     /**
-     * Returns whether or not this parser supports validating XML content.
+     * Returns whether or not this parser supports validating XML content
as
+     * it is parsed.
      */
     public abstract boolean isValidating();
 }
Index: src/javax/xml/parsers/SAXParserFactory.java
===================================================================
RCS file:
/home/cvspublic/xml-xerces/java/src/javax/xml/parsers/SAXParserFactory.java,
v
retrieving revision 1.4
diff -u -r1.4 SAXParserFactory.java
--- src/javax/xml/parsers/SAXParserFactory.java	2000/06/02 23:42:21	1.4
+++ src/javax/xml/parsers/SAXParserFactory.java	2000/10/15 01:26:56
@@ -58,6 +58,8 @@
 package javax.xml.parsers;
 
 import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotRecognizedException;
+import org.xml.sax.SAXNotSupportedException;
 
 /**
  * The <code>SAXParserFactory</code> defines a factory API that enables
@@ -67,13 +69,13 @@
  * <br>
  * <b>ATTENTION:</b> THIS IMPLEMENTATION OF THE "JAVAX.XML.PARSER" CLASSES
  *   IS NOT THE OFFICIAL REFERENCE IMPLEMENTATION OF THE JAVA SPECIFICATION
- *   REQUEST 5 FOUND AT
- *   <a
href="http://java.sun.com/aboutJava/communityprocess/jsr/jsr_005_xml.html">
- *   http://java.sun.com/aboutJava/communityprocess/jsr/jsr_005_xml.html
+ *   REQUEST 63 FOUND AT
+ *   <a
href="http://java.sun.com/aboutJava/communityprocess/jsr/jsr_063_jaxp11.html
">
+ *   http://java.sun.com/aboutJava/communityprocess/jsr/jsr_063_jaxp11.html
  *   </a><br>
- *   THIS IMPLEMENTATION IS CONFORMANT TO THE "JAVA API FOR XML PARSING"
- *   SPECIFICATION VERSION 1.0 PUBLIC RELEASE 1 BY JAMES DUNCAN DAVIDSON
- *   PUBLISHED BY SUN MICROSYSTEMS ON FEB. 18, 2000 AND FOUND AT
+ *   THIS IMPLEMENTATION IS CONFORMANT TO THE "JAVA API FOR XML PROCESSING"
+ *   SPECIFICATION VERSION 1.1 BY JAMES DUNCAN DAVIDSON AND RAJIV MORDANI
+ *   PUBLISHED FOR PUBLIC REVIEW BY SUN MICROSYSTEMS ON OCT. 2, 2000 AND
FOUND AT
  *   <a href="http://java.sun.com/xml">http://java.sun.com/xml</a>
  * <br>
  * <br>
@@ -90,13 +92,13 @@
  *
  * @author <a href="pier@betaversion.org">Pierpaolo Fumagalli</a>
  * @author Copyright &copy; 2000 The Apache Software Foundation.
- * @version 1.0 CVS $Revision: 1.4 $ $Date: 2000/06/02 23:42:21 $
+ * @version 1.1 CVS $Revision: 1.4 $ $Date: 2000/06/02 23:42:21 $
  */
 public abstract class SAXParserFactory {
 
-    /** Wether the SAXParser to be generated must support namespaces. */
+    /** Whether the SAXParser to be generated must support namespaces. */
     private boolean namespaces=false;
-    /** Wether the SAXParser to be generated must support validataion. */
+    /** Whether the SAXParser to be generated must support validation. */
     private boolean validation=false;
     /** The system property to check for the SAXParserFactory class name.
*/
     private static String property="javax.xml.parsers.SAXParserFactory";
@@ -109,7 +111,7 @@
      * <code>newInstance()</code> method to work correctly.
      * <br>
      * Application programmers should be able to instantiate an
implementation
-     * of this abstract class directly if they want to use a specfic
+     * of this abstract class directly if they want to use a specific
      * implementation of this API without using the static newInstance
method
      * to obtain the configured or platform default implementation.
      */
@@ -120,10 +122,20 @@
     /**
      * Returns a new instance of a <code>SAXParserFactory</code>.
      * <br>
-     * The implementation of the SAX-ParserFactory returned depends on the
-     * setting of the <code>javax.xml.parsers.SAXParserFactory</code>
-     * system property or, if the property is not set, a platform specific
-     * default.
+     * This method uses the following ordered lookup procedure to determine
the
+     * <code>SAXParserFactory</code> implementation class to load:
+     * <br>
+     * * Use the <code>javax.xml.parsers.SAXParserFactory</code> system
property.
+     * <br>
+     * * Use the JAVA_HOME/lib/jaxp.properties for a property file that
contains
+     *   the name of the implementation class keyed on the same value as
the system
+     *   property defined above.
+     * <br>
+     * * Use the Services API, if available, to determine the classname
from the
+     *   file
<code>META-INF/services/javax.xml.parsers.SAXParserFactory</code> in
+     *   jars available to the runtime.
+     * <br>
+     * * Platform default <code>SAXParserFactory</code> instance.
      *
      * @exception FactoryConfigurationError If the class implementing the
      *                factory cannot be found or instantiated.
@@ -133,6 +145,8 @@
      */
     public static SAXParserFactory newInstance() {
 
+        // TODO: Add other methods to find property value based on the
above documentation.
+
         // Retrieve the javax.xml.parsers.SAXParserFactory system property
         String n=factory;
         try {
@@ -189,7 +203,7 @@
      * <b>NOTE:</b> if a parser cannot be created by this factory that
      *     satisfies the requested namespace awareness value, a
      *     <code>ParserConfigurationException</code> will be thrown when
the
-     *     program attempts to aquire the parser calling the
+     *     program attempts to aquire the parser via the
      *     <code>newSaxParser()</code> method.
      */
     public void setNamespaceAware(boolean aware) {
@@ -197,7 +211,7 @@
     }
 
     /**
-     * Configuration method whether specifies if the parsers created by
this
+     * Configuration method that specifies whether the parsers created by
this
      * factory are required to validate the XML documents that they parse.
      * <br>
      * <b>NOTE:</b> if a parser cannot be created by this factory that
@@ -225,4 +239,28 @@
     public boolean isValidating() {
         return(this.validation);
     }
+
+    /**
+     * Configuration mechanism that specifies that the parsers created by
this
+     * factory are configured with the given feature.  This API was
introduced
+     * in SAX 2.0 and allows users to configure the underlying SAX parser.
+     *
+     * @exception SAXNotRecognizedException If the underlying parser can't
+     *                recognize the option.
+     * @exception SAXNotSupportedException If the underlying parser
recognizes
+     *                but doesn't support the option.
+     */
+    public abstract void setFeature(String name, boolean value)
+    throws SAXNotRecognizedException, SAXNotSupportedException;
+
+    /**
+     * Returns the value of the requested feature.
+     *
+     * @exception SAXNotRecognizedException If the underlying parser can't
+     *                recognize the option.
+     * @exception SAXNotSupportedException If the underlying parser
recognizes
+     *                but doesn't support the option.
+     */
+    public abstract boolean getFeature(String name)
+    throws SAXNotRecognizedException, SAXNotSupportedException;
 }
Index: src/org/apache/xerces/jaxp/SAXParserFactoryImpl.java
===================================================================
RCS file:
/home/cvspublic/xml-xerces/java/src/org/apache/xerces/jaxp/SAXParserFactoryI
mpl.java,v
retrieving revision 1.2
diff -u -r1.2 SAXParserFactoryImpl.java
--- src/org/apache/xerces/jaxp/SAXParserFactoryImpl.java	2000/06/09
17:03:45	1.2
+++ src/org/apache/xerces/jaxp/SAXParserFactoryImpl.java	2000/10/15
01:26:58
@@ -61,6 +61,8 @@
 import javax.xml.parsers.SAXParser;
 import javax.xml.parsers.SAXParserFactory;
 import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotRecognizedException;
+import org.xml.sax.SAXNotSupportedException;
 
 /**
  * The <code>SAXParserFactory</code> implementation for the Apache Xerces
@@ -85,5 +87,23 @@
     public SAXParser newSAXParser()
     throws ParserConfigurationException {
         return(new
SAXParserImpl(this.isNamespaceAware(),this.isValidating()));
+    }
+
+    /**
+     * Configure the given feature for parsers created by this factory.
+     */
+    public void setFeature(String name, boolean value)
+    throws SAXNotRecognizedException, SAXNotSupportedException {
+        // TODO: Implement this method.
+        throw new SAXNotRecognizedException("Need to hook into feature
setting here");
+    }
+
+    /**
+     * Returns the value of the given feature.
+     */
+    public boolean getFeature(String name)
+    throws SAXNotRecognizedException, SAXNotSupportedException {
+        // TODO: Implement this method.
+        throw new SAXNotRecognizedException("Need to hook into feature
getting here");
     }
 }
Index: src/org/apache/xerces/jaxp/SAXParserImpl.java
===================================================================
RCS file:
/home/cvspublic/xml-xerces/java/src/org/apache/xerces/jaxp/SAXParserImpl.jav
a,v
retrieving revision 1.2
diff -u -r1.2 SAXParserImpl.java
--- src/org/apache/xerces/jaxp/SAXParserImpl.java	2000/06/09 17:03:45
1.2
+++ src/org/apache/xerces/jaxp/SAXParserImpl.java	2000/10/15 01:26:58
@@ -65,7 +65,10 @@
 import org.xml.sax.HandlerBase;
 import org.xml.sax.InputSource;
 import org.xml.sax.Parser;
+import org.xml.sax.XMLReader;
 import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotRecognizedException;
+import org.xml.sax.SAXNotSupportedException;
 
 /**
  * The <code>SAXParser</code> implementation for the Apache Xerces XML
parser.
@@ -76,12 +79,12 @@
  */
 public class SAXParserImpl extends javax.xml.parsers.SAXParser {
 
-    /** Wether this <code>SAXParserImpl</code> supports namespaces. */
+    /** Whether this <code>SAXParserImpl</code> supports namespaces. */
     private boolean namespaces=false;
-    /** Wether this <code>SAXParserImpl</code> supports validataion. */
+    /** Whether this <code>SAXParserImpl</code> supports validataion. */
     private boolean validation=false;
     /** The current Xerces SAX <code>Parser</code>. */
-    private Parser parser=null;
+    private SAXParser parser=null;
 
     /** Deny no-argument construction. */
     private SAXParserImpl() {
@@ -89,7 +92,7 @@
     }
 
     /**
-     * Create a new <code>SAXParserFactoryImpl</code> instance.
+     * Create a new <code>SAXParserImpl</code> instance.
      */
     protected SAXParserImpl(boolean namespaces, boolean validation)
     throws ParserConfigurationException {
@@ -113,10 +116,34 @@
     }
 
     /**
+     *  Set implementation-specific property with the given value.
+     */
+    public void setProperty(String name, Object value)
+    throws SAXNotRecognizedException, SAXNotSupportedException {
+        this.parser.setProperty(name, value);
+    }
+
+    /**
+     *  Return the value of the requested property.
+     */
+    public Object getProperty(String name)
+    throws SAXNotRecognizedException, SAXNotSupportedException {
+        return(this.parser.getProperty(name));
+    }
+
+    /**
      * Returns the underlying <code>Parser</code> object which is wrapped
by
      * this <code>SAXParserImpl</code> implementation.
      */
     public Parser getParser() {
+        return(this.parser);
+    }
+
+    /**
+     * Returns the underlying <code>XMLReader</code> object which is
wrapped by
+     * this <code>SAXParserImpl</code> implementation.
+     */
+    public XMLReader getXMLReader() {
         return(this.parser);
     }
 

Re: [PATCH] Update SAXParser and Factory to JAXP 1.1 Public Review spec.

Posted by Edwin Goei <Ed...@eng.sun.com>.
"Timm, Sean" wrote:
> 
> I wanted to be able to compile Tomcat 4.0 with just Xerces, so I updated the
> JAXP classes on the SAX side to match the new 1.1 spec.  There are still a
> few changes to be made, but it suits my purposes.  :)  I have not provided
> an implementation that does anything for getProperty or setProperty on the
> SAXParserFactory, nor have I handled the two new parse methods for SAXParser
> that allow you to pass in a base URI to resolve to (instead it just acts as
> if you hadn't passed that in).  Other than that, it should work just fine.
> (Just search for TODO to see what I didn't do.)
> 
> On a side note, are the javax.xml classes supposed to reside inside each
> implementation of JAXP?  The licensing seems a bit unfriendly for that.  At
> any rate, I didn't want any sort of legal hassles, so I haven't even
> downloaded the JAXP1.1 early access release.

The people I've talked to would like to see the javax.xml classes shared
between parsers so that there is only a single implementation.  The JAXP
1.1EA release has those classes in a separate jar file for that
purpose.  However, JAXP 1.1 has not been finalized yet.  My take on it
is that the 1.1EA license was created to prevent a not-yet-final version
of 1.1 from being distributed as a final version.  Seems unnecessary to
me IMHO, because after all, public domain standards such as SAX do fine
without such licenses.  So feel free to download the JAXP 1.1EA release
if you want and extract the jaxp.jar file.

BTW, I've heard that the javax.xml.transform package could change before
1.1 becomes final.

-Edwin