logo       
Google Custom Search
    AddThis Social Bookmark Button

Two changes to ErrorHandler: msg#00056

Subject: Two changes to ErrorHandler
The attached patch makes two changes to the ErrorHandler documentation:

1. It clarifies that namespace well-formedness errors are fatal errors. Crimson is not in conformanc with this, which has been a major problem for many users. All other parsers written in Java seem to implement this correctly.

2. It clarifies that parsers MUST NOT continue reporting events in the normal way following a fatal error. Previously the docs gave the erroneous impression that this could be done at parser option. However, doing so would be in direct violation of the XML specification.

--
Elliotte Rusty Harold
Index: src/org/xml/sax/ErrorHandler.java
===================================================================
RCS file: /cvsroot/sax/sax2/src/org/xml/sax/ErrorHandler.java,v
retrieving revision 1.10
diff -u -r1.10 ErrorHandler.java
--- src/org/xml/sax/ErrorHandler.java   8 Mar 2004 13:01:00 -0000       1.10
+++ src/org/xml/sax/ErrorHandler.java   25 Apr 2004 14:51:45 -0000
@@ -64,10 +64,10 @@
      * <p>Filters may use this method to report other, non-XML warnings
      * as well.</p>
      *
-     * @param exception The warning information encapsulated in a
-     *                  SAX parse exception.
-     * @exception org.xml.sax.SAXException Any SAX exception, possibly
-     *            wrapping another exception.
+     * @param exception the warning information encapsulated in a
+     *                  SAX parse exception
+     * @throws org.xml.sax.SAXException any SAX exception, possibly
+     *            wrapping another exception
      * @see org.xml.sax.SAXParseException 
      */
     public abstract void warning (SAXParseException exception)
@@ -93,10 +93,10 @@
      * <p>Filters may use this method to report other, non-XML errors
      * as well.</p>
      *
-     * @param exception The error information encapsulated in a
-     *                  SAX parse exception.
-     * @exception org.xml.sax.SAXException Any SAX exception, possibly
-     *            wrapping another exception.
+     * @param exception the error information encapsulated in a
+     *                  SAX parse exception
+     * @throws org.xml.sax.SAXException any SAX exception, possibly
+     *            wrapping another exception
      * @see org.xml.sax.SAXParseException 
      */
     public abstract void error (SAXParseException exception)
@@ -119,16 +119,24 @@
      * parser would use this callback to report the violation of a
      * well-formedness constraint.</p>
      *
+     * <p>
+     * This method is also used to report violations of namespace
+     * well-formedness as defined in <cite>Namespaces in XML</cite>,
+     * for instance an element name that contains an unmapped prefix,
+     * an attribute name beginning with a colon, or a processing 
+     * instruction target that contains a prefix. 
+     * </p>
+     *
      * <p>The application must assume that the document is unusable
      * after the parser has invoked this method, and should continue
      * (if at all) only for the sake of collecting additional error
-     * messages: in fact, SAX parsers are free to stop reporting any
-     * other events once this method has been invoked.</p>
+     * messages: in fact, SAX parsers must stop reporting any
+     * other non-error events once this method has been invoked.</p>
      *
-     * @param exception The error information encapsulated in a
+     * @param exception the error information encapsulated in a
      *                  SAX parse exception.  
-     * @exception org.xml.sax.SAXException Any SAX exception, possibly
-     *            wrapping another exception.
+     * @throws org.xml.sax.SAXException any SAX exception, possibly
+     *            wrapping another exception
      * @see org.xml.sax.SAXParseException
      */
     public abstract void fatalError (SAXParseException exception)

Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>