xerces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eri...@locus.apache.org
Subject cvs commit: xml-xerces/java/src/org/apache/xerces/impl XMLDocumentScanner.java
Date Fri, 06 Oct 2000 23:33:16 GMT
ericye      00/10/06 16:33:16

  Modified:    java/src/org/apache/xerces/impl Tag: xerces_j_2
                        XMLDocumentScanner.java
  Log:
  handle eof and invalid cahr in ContentDispatcher
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.18  +22 -6     xml-xerces/java/src/org/apache/xerces/impl/Attic/XMLDocumentScanner.java
  
  Index: XMLDocumentScanner.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/Attic/XMLDocumentScanner.java,v
  retrieving revision 1.1.2.17
  retrieving revision 1.1.2.18
  diff -u -r1.1.2.17 -r1.1.2.18
  --- XMLDocumentScanner.java	2000/10/06 22:48:52	1.1.2.17
  +++ XMLDocumentScanner.java	2000/10/06 23:33:16	1.1.2.18
  @@ -100,7 +100,7 @@
    * @author Stubs generated by DesignDoc on Mon Sep 11 11:10:57 PDT 2000
    * @author Andy Clark, IBM
    *
  - * @version $Id: XMLDocumentScanner.java,v 1.1.2.17 2000/10/06 22:48:52 lehors Exp $
  + * @version $Id: XMLDocumentScanner.java,v 1.1.2.18 2000/10/06 23:33:16 ericye Exp $
    */
   public class XMLDocumentScanner
       extends XMLScanner
  @@ -412,6 +412,9 @@
               if (property.equals(Constants.DTD_SCANNER_PROPERTY)) {
                   fDTDScanner = (XMLDTDScanner)value;
               }
  +            else if (property.equals(Constants.ENTITY_MANAGER_PROPERTY)) {
  +                fEntityManager = (XMLEntityManager)value;
  +            }
               return;
           }
           /***/
  @@ -1596,8 +1599,6 @@
                           fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
                                                      "ReferenceIllegalInProlog",
                                                      null,XMLErrorReporter.SEVERITY_FATAL_ERROR);
  -                        // REVISIT: report error
  -                        throw new SAXException("reference not allowed in prolog");
                       }
                   }
               } while (complete || again);
  @@ -1620,6 +1621,7 @@
        * Dispatcher to handle content scanning.
        *
        * @author Andy Clark, IBM
  +     * @author Eric Ye, IBM
        */
       protected final class ContentDispatcher
           implements Dispatcher {
  @@ -1705,8 +1707,21 @@
                                       fEntityScanner.scanChar();
                                       setScannerState(SCANNER_STATE_REFERENCE);
                                       break;
  +                                }
  +                                else if (c == -1) {
  +                                    
  +                                    fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
"ETagRequired",
  +                                                               new Object[] {fCurrentElement.rawname},
  +                                                               XMLErrorReporter.SEVERITY_FATAL_ERROR);
  +
  +                                    setScannerState(SCANNER_STATE_TERMINATED);
  +                                    return false;
  +                                }
  +                                else {
  +                                    fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
"InvalidCharInContent",
  +                                                               new Object[] {Integer.toString(c,
16)},
  +                                                               XMLErrorReporter.SEVERITY_FATAL_ERROR);
                                   }
  -                                // REVISIT: eof, invalid char
                               }
                           }
                           break;
  @@ -1825,8 +1840,9 @@
                                   return false;
                               }
                               else {
  -                                // REVISIT report error
  -                                // throw new SAXException("invalid char in trailing Misc);
  +                                fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
"InvalidCharInMisc",
  +                                                           new Object[] {Integer.toString(ch,
16)},
  +                                                           XMLErrorReporter.SEVERITY_FATAL_ERROR);
                                   setScannerState(SCANNER_STATE_TERMINATED);
                                   return false;
                               }
  
  
  

Mime
View raw message