You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by an...@locus.apache.org on 2000/04/04 20:34:56 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/readers AbstractCharReader.java

andyc       00/04/04 11:34:56

  Modified:    java/src/org/apache/xerces/readers AbstractCharReader.java
  Added:       java/src/org/apache/xerces/framework XMLContentSpec.java
                        XMLDocumentHandler.java
  Log:
  PHASE1: Creating new files for internal re-architecture.
  
  Revision  Changes    Path
  1.1                  xml-xerces/java/src/org/apache/xerces/framework/XMLContentSpec.java
  
  Index: XMLContentSpec.java
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   *
   * Copyright (c) 1999 The Apache Software Foundation.  All rights 
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer. 
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:  
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Xerces" and "Apache Software Foundation" must
   *    not be used to endorse or promote products derived from this
   *    software without prior written permission. For written 
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation and was
   * originally based on software copyright (c) 1999, International
   * Business Machines, Inc., http://www.apache.org.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  package org.apache.xerces.framework;
  
  /**
   * ContentSpec really exists to aid the parser classes in implementing
   * access to the grammar.
   *
   * This class is used by the DTD scanner and the validator classes,
   * allowing them to be used separately or together.  This "struct"
   * class is used to build content models for validation, where it
   * is more efficient to fetch all of the information for each of
   * these content model "fragments" than to fetch each field one at
   * a time.  Since configurations are allowed to have validators
   * without a DTD scanner (i.e. a schema validator) and a DTD scanner
   * without a validator (non-validating processor), this class can be
   * used by each without requiring the presence of the other.
   *
   * When processing element declarations, the DTD scanner will build
   * up a representation of the content model using the node types that
   * are defined here.  Since a non-validating processor only needs to
   * remember the type of content model declared (i.e. ANY, EMPTY, MIXED,
   * or CHILDREN), it is free to discard the specific details of the
   * MIXED and CHILDREN content models described using this class.
   *
   * In the typical case of a validating processor reading the grammar
   * of the document from a DTD, the information about the content model
   * declared will be preserved and later "compiled" into an efficient
   * form for use during element validation.  Each content spec node
   * that is saved is assigned a unique index that is used as a handle
   * for the "value" or "otherValue" fields of other content spec nodes.
   * A leaf node has a "value" that is either an index in the string
   * pool of the element type of that leaf, or a value of -1 to indicate
   * the special "#PCDATA" leaf type used in a mixed content model.
   *
   * For a mixed content model, the content spec will be made up of
   * leaf and choice content spec nodes, with an optional "zero or more"
   * node.  For example, the mixed content declaration "(#PCDATA)" would
   * contain a single leaf node with a node value of -1.  A mixed content
   * declaration of "(#PCDATA|foo)*" would have a content spec consisting
   * of two leaf nodes, for the "#PCDATA" and "foo" choices, a choice node
   * with the "value" set to the index of the "#PCDATA" leaf node and the
   * "otherValue" set to the index of the "foo" leaf node, and a "zero or
   * more" node with the "value" set to the index of the choice node.  If
   * the content model has more choices, for example "(#PCDATA|a|b)*", then
   * there will be more corresponding choice and leaf nodes, the choice
   * nodes will be chained together through the "value" field with each
   * leaf node referenced by the "otherValue" field.
   *
   * For element content models, there are sequence nodes and also "zero or
   * one" and "one or more" nodes.  The leaf nodes would always have a valid
   * string pool index, as the "#PCDATA" leaf is not used in the declarations
   * for element content models.
   *
   * @version
   */
  
  public interface XMLContentSpec {
      /**
       * return this ContentSpec as a string
       *
       * @return the content spec as a string
       */
      public String toString();
      /**
       * return the type of this ContentSpec
       *
       * @return The string pool handle for the type of this ContentSpec
       */
      public int getType();
      /**
       * get this ContentSpec's handle
       *
       * @return handle for this ContentSpec
       */
      public int getHandle();
      /**
       * fill in XMLContentSpec.Node node with the information for
       * ContentSpec in handle
       * 
       * @param handle ContentSpec handle
       * @param node result XMLContentSpec.Node
       */
      public void getNode(int handle, XMLContentSpec.Node node);
  
      //
      // node type
      //
      // Note: The #PCDATA leaf in a MIXED content spec is indicated by a type
      //       of CONTENTSPECNODE_LEAF and an value of -1.
      //
      public static final int
          CONTENTSPECNODE_LEAF           = 0,            // Name or #PCDATA (-1)
          CONTENTSPECNODE_ZERO_OR_ONE    = 1,            // '?'
          CONTENTSPECNODE_ZERO_OR_MORE   = 2,            // '*'
          CONTENTSPECNODE_ONE_OR_MORE    = 3,            // '+'
          CONTENTSPECNODE_CHOICE         = 4,            // '|'
          CONTENTSPECNODE_SEQ            = 5;            // ','
  
      //
      // Node record
      //
      public final class Node {
          //
          // Public instance variables - filled in on each call to getNode().
          //
          public int type;                    // node type (see above)
          public int value;                   // leaf index, single child for unary ops, left child for binary ops.
          public int otherValue;              // right child for binary ops
      }
  }
  
  
  
  1.1                  xml-xerces/java/src/org/apache/xerces/framework/XMLDocumentHandler.java
  
  Index: XMLDocumentHandler.java
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   *
   * Copyright (c) 1999 The Apache Software Foundation.  All rights 
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer. 
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:  
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Xerces" and "Apache Software Foundation" must
   *    not be used to endorse or promote products derived from this
   *    software without prior written permission. For written 
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation and was
   * originally based on software copyright (c) 1999, International
   * Business Machines, Inc., http://www.apache.org.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  package org.apache.xerces.framework;
  
  /**
   * 
   * XMLValidator defines the interface that XMLDocumentScanner and XML
   * EntityHandler have with an object that serves as a pluggable validator.
   * This abstraction allows validators for XML grammar languages to be
   * plugged in and queried for validity checks as the scanner processes
   * a document.
   *
   * The document scanner and entity handler need to ask the validator object
   * for this information because the validator object is responsible for reading
   * the grammar specification file (which contains markup declarations and entity
   * declarations)
   *
   * @version
   */
  
  public interface XMLDocumentHandler {
  
      /**
       * Callback for start of document
       *
       * If the there is no version info, encoding info, or standalone info,
       * the corresponding argument will be set to -1.
       *
       * @exception java.lang.Exception
       */
      public void startDocument()  throws Exception;
  
      /**
       * callback for the end of document.
       *
       * @exception java.lang.Exception
       */
      public void endDocument() throws Exception;
  
      /**
       * Signal the XML declaration of a document
       *
       * @param version the handle in the string pool for the version number
       * @param encoding the handle in the string pool for the encoding
       * @param standalong the handle in the string pool for the standalone value
       * @exception java.lang.Exception
       */
      public void xmlDecl(int version, int encoding, int standalone) throws Exception;
  
      /**
       * Signal the Text declaration of an external entity.
       *
       * @exception java.lang.Exception
       */
      public void textDecl(int version, int encoding) throws Exception;
  
      /**
       * callback for the start of a namespace declaration scope.
       *
       * @param prefix string pool index of the namespace prefix being declared
       * @param uri string pool index of the namespace uri begin bound
       * @param java.lang.Exception
       */
      public void startNamespaceDeclScope(int prefix, int uri) throws Exception;
  
      /**
       * callback for the end a namespace declaration scope.
       *
       * @param prefix string pool index of the namespace prefix being declared
       * @exception java.lang.Exception
       */
      public void endNamespaceDeclScope(int prefix) throws Exception;
  
      /**
       * callback for the start of element.
       *
       * @param elementType element handle for the element being scanned
       * @param attrList attrList containing the attributes of the element
       * @param attrListHandle handle into attrList.  Allows attributes to be retreived.
       * @exception java.lang.Exception
       */
      public void startElement(int elementType, XMLAttrList attrList, int attrListHandle) throws Exception;
  
      /**
       * callback for end of element.
       *
       * @param elementType element handle for the element being scanned
       * @exception java.lang.Exception
       */
      public void endElement(int elementType) throws Exception;
  
      /**
       * callback for start of entity reference.
       *
       * @param entityName string pool index of the entity name
       * @param entityType the XMLEntityHandler.ENTITYTYPE_* type
       * @see org.apache.xerces.readers.XMLEntityHandler
       * @param entityContext the XMLEntityHandler.ENTITYREF_* type for where
       *        the entity reference appears
       * @see org.apache.xerces.readers.XMLEntityHandler
       * @exception java.lang.Exception
       */
      public void startEntityReference(int entityName, int entityType, int entityContext) throws Exception;
  
      /**
       * callback for end of entity reference.
       *
       * @param entityName string pool index of the entity anem
       * @param entityType the XMLEntityHandler.ENTITYTYPE_* type
       * @see org.apache.xerces.readers.XMLEntityHandler
       * @param entityContext the XMLEntityHandler.ENTITYREF_* type for where
       *        the entity reference appears
       * @see org.apache.xerces.readers.XMLEntityHandler
       * @exception java.lang.Exception
       */
      public void endEntityReference(int entityName, int entityType, int entityContext) throws Exception;
  
      /**
       * callback for processing instruction.
       *
       * @param target string pool index of the PI target
       * @param data string pool index of the PI data
       * @exception java.lang.Exception
       */
      public void processingInstruction(int target, int data) throws Exception;
  
      /**
       * callback for comment.
       *
       * @param comment string pool index of the comment text
       * @exception java.lang.Exception
       */
      public void comment(int comment) throws Exception;
  
      /**
       * callback for characters (string pool form).
       *
       * @param data string pool index of the characters that were scanned
       * @exception java.lang.Exception
       */
      public void characters(int data) throws Exception;
  
      /**
       * callback for characters.
       *
       * @param ch character array containing the characters that were scanned
       * @param start offset in ch where scanned characters begin
       * @param length length of scanned characters in ch
       * @exception java.lang.Exception
       */
      public void characters(char ch[], int start, int length) throws Exception;
  
      /**
       * callback for ignorable whitespace.
       *
       * @param data string pool index of ignorable whitespace
       * @exception java.lang.Exception
       */
      public void ignorableWhitespace(int data) throws Exception;
  
      /**
       * callback for ignorable whitespace.
       *
       * @param ch character array containing the whitespace that was scanned
       * @param start offset in ch where scanned whitespace begins
       * @param length length of scanned whitespace in ch
       * @exception java.lang.Exception
       */
      public void ignorableWhitespace(char ch[], int start, int length) throws Exception;
  
      /**
       * callback for start of CDATA section.
       * this callback marks the start of a CDATA section
       *
       * @exception java.lang.Exception
       */
      public void startCDATA() throws Exception;
  
      /**
       * callback for end of CDATA section.
       * this callback marks the end of a CDATA section
       *
       * @exception java.lang.Exception
       */
      public void endCDATA() throws Exception;
  
      //
      // Additional DTD specific events.
      //
      public interface DTDHandler {
          /**
           * callback for the start of the DTD
           * This function will be called when a &lt;!DOCTYPE...&gt; declaration is
           * encountered.
           *
           * @param rootElementType element handle for the root element of the document
           * @param publicId string pool index of the DTD's public ID
           * @param systemId string pool index of the DTD's system ID
           * @exception java.lang.Exception
           */
          public void startDTD(int rootElementType, int publicId, int systemId) throws Exception;
  
          /**
           * Supports DOM Level 2 internalSubset additions.
           * Called when the internal subset is completely scanned.
           */
          public void internalSubset(int internalSubset) throws Exception;
  
          /**
           * Signal the Text declaration of an external entity.
           *
           * @exception java.lang.Exception
           */
          public void textDecl(int version, int encoding) throws Exception;
  
          /**
           * callback for the end of the DTD
           * This function will be called at the end of the DTD. 
           */
          public void endDTD() throws Exception;
  
          /**
           * callback for an element declaration. 
           *
           * @param elementType element handle of the element being declared
           * @param contentSpec contentSpec for the element being declared
           * @see org.apache.xerces.framework.XMLContentSpec
           * @exception java.lang.Exception
           */
          public void elementDecl(int elementType, XMLContentSpec contentSpec) throws Exception;
  
          /**
           * callback for an attribute list declaration. 
           *
           * @param elementType element handle for the attribute's element
           * @param attrName string pool index of the attribute name
           * @param attType type of attribute
           * @param enumString String representing the values of the enumeration,
           *        if the attribute is of enumerated type, or null if it is not.
           * @param attDefaultType an integer value denoting the DefaultDecl value
           * @param attDefaultValue string pool index of this attribute's default value 
           *        or -1 if there is no defaultvalue 
           * @exception java.lang.Exception
           */
          public void attlistDecl(int elementType,
                                  int attrName,
                                  int attType,
                                  String enumString,
                                  int attDefaultType,
                                  int attDefaultValue) throws Exception;
  
          /**
           * callback for an internal parameter entity declaration.
           *
           * @param entityName string pool index of the entity name
           * @param entityValue string pool index of the entity replacement text
           * @exception java.lang.Exception
           */
          public void internalPEDecl(int entityName, int entityValue) throws Exception;
  
          /**
           * callback for an external parameter entity declaration. 
           *
           * @param entityName string pool index of the entity name
           * @param publicId string pool index of the entity's public id.
           * @param systemId string pool index of the entity's system id.
           * @exception java.lang.Exception
           */
          public void externalPEDecl(int entityName, int publicId, int systemId) throws Exception;
  
          /**
           * callback for internal general entity declaration. 
           *
           * @param entityName string pool index of the entity name
           * @param entityValue string pool index of the entity replacement text
           * @exception java.lang.Exception
           */
          public void internalEntityDecl(int entityName, int entityValue) throws Exception;
  
          /**
           * callback for external general entity declaration. 
           *
           * @param entityName string pool index of the entity name
           * @param publicId string pool index of the entity's public id.
           * @param systemId string pool index of the entity's system id.
           * @exception java.lang.Exception
           */
          public void externalEntityDecl(int entityName, int publicId, int systemId) throws Exception;
  
          /**
           * callback for an unparsed entity declaration. 
           *
           * @param entityName string pool index of the entity name
           * @param publicId string pool index of the entity's public id.
           * @param systemId string pool index of the entity's system id.
           * @param notationName string pool index of the notation name.
           * @exception java.lang.Exception
           */
          public void unparsedEntityDecl(int entityName, int publicId, int systemId, int notationName) throws Exception;
  
          /**
           * callback for a notation declaration.
           *
           * @param notationName string pool index of the notation name
           * @param publicId string pool index of the notation's public id.
           * @param systemId string pool index of the notation's system id.
           * @exception java.lang.Exception
           */
          public void notationDecl(int notationName, int publicId, int systemId) throws Exception;
  
          /**
           * Callback for processing instruction in DTD.  
           *
           * @param target the string pool index of the PI's target
           * @param data the string pool index of the PI's data
           * @exception java.lang.Exception
           */
          public void processingInstruction(int targetIndex, int dataIndex) throws Exception;
  
          /**
           * Callback for comment in DTD.
           * 
           * @param comment the string pool index of the comment text
           * @exception java.lang.Exception
           */
          public void comment(int dataIndex) throws Exception;
      }
  }
  
  
  
  1.2       +45 -8     xml-xerces/java/src/org/apache/xerces/readers/AbstractCharReader.java
  
  Index: AbstractCharReader.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/readers/AbstractCharReader.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractCharReader.java	1999/11/09 01:12:30	1.1
  +++ AbstractCharReader.java	2000/04/04 18:34:55	1.2
  @@ -376,6 +376,10 @@
               if (XMLCharacterProperties.fgAsciiInitialNameChar[ch] == 0)
                   return;
           } else {
  +            if (!fCalledCharPropInit) {
  +                XMLCharacterProperties.initCharFlags();
  +                fCalledCharPropInit = true;
  +            }
               if ((XMLCharacterProperties.fgCharFlags[ch] & XMLCharacterProperties.E_InitialNameCharFlag) == 0)
                   return;
           }
  @@ -388,6 +392,10 @@
                   if (XMLCharacterProperties.fgAsciiNameChar[ch] == 0)
                       return;
               } else {
  +                if (!fCalledCharPropInit) {
  +                    XMLCharacterProperties.initCharFlags();
  +                    fCalledCharPropInit = true;
  +                }
                   if ((XMLCharacterProperties.fgCharFlags[ch] & XMLCharacterProperties.E_NameCharFlag) == 0)
                       return;
               }
  @@ -406,6 +414,10 @@
                   if (XMLCharacterProperties.fgAsciiNameChar[ch] == 0)
                       return;
               } else {
  +                if (!fCalledCharPropInit) {
  +                    XMLCharacterProperties.initCharFlags();
  +                    fCalledCharPropInit = true;
  +                }
                   if ((XMLCharacterProperties.fgCharFlags[ch] & XMLCharacterProperties.E_NameCharFlag) == 0)
                       return;
               }
  @@ -669,6 +681,10 @@
               if (XMLCharacterProperties.fgAsciiInitialNameChar[ch] == 0)
                   return -1;
           } else {
  +            if (!fCalledCharPropInit) {
  +                XMLCharacterProperties.initCharFlags();
  +                fCalledCharPropInit = true;
  +            }
               if ((XMLCharacterProperties.fgCharFlags[ch] & XMLCharacterProperties.E_InitialNameCharFlag) == 0)
                   return -1;
           }
  @@ -692,6 +708,10 @@
                   if (XMLCharacterProperties.fgAsciiNameChar[ch] == 0)
                       break;
               } else {
  +                if (!fCalledCharPropInit) {
  +                    XMLCharacterProperties.initCharFlags();
  +                    fCalledCharPropInit = true;
  +                }
                   if ((XMLCharacterProperties.fgCharFlags[ch] & XMLCharacterProperties.E_NameCharFlag) == 0)
                       break;
               }
  @@ -737,6 +757,10 @@
               if (XMLCharacterProperties.fgAsciiNameChar[ch] == 0)
                   return true;
           } else {
  +            if (!fCalledCharPropInit) {
  +                XMLCharacterProperties.initCharFlags();
  +                fCalledCharPropInit = true;
  +            }
               if ((XMLCharacterProperties.fgCharFlags[ch] & XMLCharacterProperties.E_NameCharFlag) == 0)
                   return true;
           }
  @@ -755,6 +779,10 @@
               if (ch == ':')
                   return -1;
           } else {
  +            if (!fCalledCharPropInit) {
  +                XMLCharacterProperties.initCharFlags();
  +                fCalledCharPropInit = true;
  +            }
               if ((XMLCharacterProperties.fgCharFlags[ch] & XMLCharacterProperties.E_InitialNameCharFlag) == 0)
                   return -1;
           }
  @@ -803,6 +831,10 @@
                           if (XMLCharacterProperties.fgAsciiInitialNameChar[ch] == 0 || ch == ':')
                               lpok = false;
                       } else {
  +                        if (!fCalledCharPropInit) {
  +                            XMLCharacterProperties.initCharFlags();
  +                            fCalledCharPropInit = true;
  +                        }
                           if ((XMLCharacterProperties.fgCharFlags[ch] & XMLCharacterProperties.E_InitialNameCharFlag) == 0)
                               lpok = false;
                       }
  @@ -813,6 +845,10 @@
                       }
                   }
               } else {
  +                if (fCalledCharPropInit) {
  +                    XMLCharacterProperties.initCharFlags();
  +                    fCalledCharPropInit = true;
  +                }
                   if ((XMLCharacterProperties.fgCharFlags[ch] & XMLCharacterProperties.E_NameCharFlag) == 0)
                       break;
               }
  @@ -1070,6 +1106,7 @@
       //
       private static final char[] cdata_string = { 'C','D','A','T','A','[' };
       private StringPool fStringPool = null;
  +    private boolean fCalledCharPropInit = false;
       private boolean fCallClearPreviousChunk = true;
       private Vector fDeferredErrors = null;
   
  @@ -1258,9 +1295,9 @@
           if (!fSendCharDataAsCharArray) {
               int stringIndex = addString(offset, length);
               if (isWhitespace)
  -                fEntityHandler.processWhitespace(stringIndex);
  +                fCharDataHandler.processWhitespace(stringIndex);
               else
  -                fEntityHandler.processCharacters(stringIndex);
  +                fCharDataHandler.processCharacters(stringIndex);
               return;
           }
   
  @@ -1272,9 +1309,9 @@
               //
               if (length != 0) {
                   if (isWhitespace)
  -                    fEntityHandler.processWhitespace(dataChunk.toCharArray(), index, length);
  +                    fCharDataHandler.processWhitespace(dataChunk.toCharArray(), index, length);
                   else
  -                    fEntityHandler.processCharacters(dataChunk.toCharArray(), index, length);
  +                    fCharDataHandler.processCharacters(dataChunk.toCharArray(), index, length);
               }
               return;
           }
  @@ -1285,9 +1322,9 @@
           int count = length;
           int nbytes = CharDataChunk.CHUNK_SIZE - index;
           if (isWhitespace)
  -            fEntityHandler.processWhitespace(dataChunk.toCharArray(), index, nbytes);
  +            fCharDataHandler.processWhitespace(dataChunk.toCharArray(), index, nbytes);
           else
  -            fEntityHandler.processCharacters(dataChunk.toCharArray(), index, nbytes);
  +            fCharDataHandler.processCharacters(dataChunk.toCharArray(), index, nbytes);
           count -= nbytes;
   
           //
  @@ -1300,9 +1337,9 @@
               }
               nbytes = count <= CharDataChunk.CHUNK_SIZE ? count : CharDataChunk.CHUNK_SIZE;
               if (isWhitespace)
  -                fEntityHandler.processWhitespace(dataChunk.toCharArray(), 0, nbytes);
  +                fCharDataHandler.processWhitespace(dataChunk.toCharArray(), 0, nbytes);
               else
  -                fEntityHandler.processCharacters(dataChunk.toCharArray(), 0, nbytes);
  +                fCharDataHandler.processCharacters(dataChunk.toCharArray(), 0, nbytes);
               count -= nbytes;
           } while (count > 0);
       }