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...@apache.org on 2001/08/23 10:09:02 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/impl XMLDTDScannerImpl.java XMLDocumentScannerImpl.java XMLEntityManager.java XMLScanner.java

andyc       01/08/23 01:09:02

  Modified:    java/docs releases.xml xni-xerces2.xml
               java/src/org/apache/xerces/impl XMLDTDScannerImpl.java
                        XMLDocumentScannerImpl.java XMLEntityManager.java
                        XMLScanner.java
  Log:
  Updates to make the Xerces2 standard components are in sync
  with the documentation regarding their supported features
  and properties.
  
  Revision  Changes    Path
  1.66      +7 -0      xml-xerces/java/docs/releases.xml
  
  Index: releases.xml
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/docs/releases.xml,v
  retrieving revision 1.65
  retrieving revision 1.66
  diff -u -r1.65 -r1.66
  --- releases.xml	2001/08/23 04:38:15	1.65
  +++ releases.xml	2001/08/23 08:09:02	1.66
  @@ -4,6 +4,13 @@
    <release version='NOT YET RELEASED'>
     <desc/>
     <changes>
  +   <fix>
  +    <note>
  +     Fixed Xerces2 standard components to properly recognize and use
  +     the features and properties that they are documented to accept.
  +    </note>
  +    <submitter name='Andy Clark'/>
  +   </fix>
      <add>
       <note>
        Added documentation to the XNI Manual for re-using the Xerces2
  
  
  
  1.3       +1 -0      xml-xerces/java/docs/xni-xerces2.xml
  
  Index: xni-xerces2.xml
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/docs/xni-xerces2.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- xni-xerces2.xml	2001/08/23 00:35:14	1.2
  +++ xni-xerces2.xml	2001/08/23 08:09:02	1.3
  @@ -358,6 +358,7 @@
     <p>Recognized features:</p>
     <ul>
      <li>http://xml.org/sax/features/validation</li>
  +   <li>http://apache.org/xml/features/scanner/notify-char-refs</li>
     </ul>
     <p>
      The <code>org.apache.xerces.impl.XMLDTDScannerImpl</code>
  
  
  
  1.3       +53 -63    xml-xerces/java/src/org/apache/xerces/impl/XMLDTDScannerImpl.java
  
  Index: XMLDTDScannerImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/XMLDTDScannerImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XMLDTDScannerImpl.java	2001/08/23 00:35:21	1.2
  +++ XMLDTDScannerImpl.java	2001/08/23 08:09:02	1.3
  @@ -81,13 +81,28 @@
   import org.apache.xerces.xni.parser.XMLInputSource;
   
   /**
  + * This class is responsible for scanning the declarations found
  + * in the internal and external subsets of a DTD in an XML document.
  + * The scanner acts as the sources for the DTD information which is 
  + * communicated to the DTD handlers.
  + * <p>
  + * This component requires the following features and properties from the
  + * component manager that uses it:
  + * <ul>
  + *  <li>http://xml.org/sax/features/validation</li>
  + *  <li>http://apache.org/xml/features/scanner/notify-char-refs</li>
  + *  <li>http://apache.org/xml/properties/internal/symbol-table</li>
  + *  <li>http://apache.org/xml/properties/internal/error-reporter</li>
  + *  <li>http://apache.org/xml/properties/internal/entity-manager</li>
  + * </ul>
  + *
    * @author Stubs generated by DesignDoc on Mon Sep 11 11:10:57 PDT 2000
    * @author Arnaud  Le Hors, IBM
    * @author Andy Clark, IBM
    * @author Glenn Marcy, IBM
    * @author Eric Ye, IBM
    *
  - * @version $Id: XMLDTDScannerImpl.java,v 1.2 2001/08/23 00:35:21 lehors Exp $
  + * @version $Id: XMLDTDScannerImpl.java,v 1.3 2001/08/23 08:09:02 andyc Exp $
    */
   public class XMLDTDScannerImpl
       extends XMLScanner
  @@ -108,28 +123,19 @@
       /** Scanner state: markup declaration. */
       protected static final int SCANNER_STATE_MARKUP_DECL = 2;
   
  -    // feature identifiers
  -
  -    /** Feature identifier: validation. */
  -    protected static final String VALIDATION = 
  -        Constants.SAX_FEATURE_PREFIX + Constants.VALIDATION_FEATURE;
  -
  -    // property identifiers
  -
  -    /** Property identifier: error reporter. */
  -    protected static final String ERROR_REPORTER =
  -        Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
  -
       // recognized features and properties
       
       /** Recognized features. */
       private static final String[] RECOGNIZED_FEATURES = {
           VALIDATION,
  +        NOTIFY_CHAR_REFS,
       };
   
       /** Recognized properties. */
       private static final String[] RECOGNIZED_PROPERTIES = {
  +        SYMBOL_TABLE,
           ERROR_REPORTER,
  +        ENTITY_MANAGER,
       };
   
       // debugging
  @@ -141,50 +147,67 @@
       // Data
       //
   
  +    // handlers
   
  -
  -    /** fErrorReporter */
  -    protected XMLErrorReporter fErrorReporter;
  -
  -    /** fDTDHandler */
  +    /** DTD handler. */
       protected XMLDTDHandler fDTDHandler;
   
  -    /** fDTDContentModelHandler */
  +    /** DTD content model handler. */
       protected XMLDTDContentModelHandler fDTDContentModelHandler;
   
  +    // state
  +
       /** Scanner state. */
       protected int fScannerState;
   
  -    /** fStandalone **/
  +    /** Standalone. */
       protected boolean fStandalone;
   
  -    /** fSeenExternalDTD **/
  +    /** Seen external DTD. */
       protected boolean fSeenExternalDTD;
   
  -    /** fSeenExternalPE **/
  +    /** Seen external parameter entity. */
       protected boolean fSeenExternalPE;
   
       // private data
   
  +    /** Start DTD called. */
       private boolean fStartDTDCalled;
   
       /** Default attribute */
       private XMLAttributesImpl fAttributes = new XMLAttributesImpl();
   
  -    // stack of operators (either '|' or ',') in children content
  +    /** 
  +     * Stack of content operators (either '|' or ',') in children 
  +     * content.
  +     */
       private int[] fContentStack = new int[5];
  -    private int fContentDepth;  // size of the stack
  +
  +    /** Size of content stack. */
  +    private int fContentDepth;
   
  -    // two parallel arrays to check well-formedness of parameter entities
  +    /** Parameter entity stack to check well-formedness. */
       private int[] fPEStack = new int[5];
  -    private int fPEDepth;       // number of opened parameter entities
   
  +    /** Number of opened parameter entities. */
  +    private int fPEDepth;
  +
  +    /** Markup depth. */
       private int fMarkUpDepth;
  -    private int fExtEntityDepth;// number of opened external entities
  -    private int fIncludeSectDepth; // number of opened include sections
   
  +    /** Number of opened external entities. */
  +    private int fExtEntityDepth;
  +
  +    /** Number of opened include sections. */
  +    private int fIncludeSectDepth;
  +
  +    /** Literal text. */
       private XMLString fLiteral = new XMLString();
  +
  +    /** Enumeration values. */
       private String[] fEnumeration = new String[5];
  +
  +    /** Enumeration values count. */
       private int fEnumerationCount;
   
       /** Ignore conditional section buffer. */
  @@ -321,12 +344,9 @@
        */
       public void reset(XMLComponentManager componentManager)
           throws XMLConfigurationException {
  +        
           super.reset(componentManager);
   
  -
  -        // Xerces properties
  -        fErrorReporter = (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER);
  -
           // reset state related data
           fStartDTDCalled = false;
           fExtEntityDepth = 0;
  @@ -341,7 +361,7 @@
           // set starting state
           setScannerState(SCANNER_STATE_TEXT_DECL);
   
  -    } // reset
  +    } // reset(XMLComponentManager)
   
       /**
        * Returns a list of feature identifiers that are recognized by
  @@ -353,23 +373,6 @@
       } // getRecognizedFeatures():String[]
   
       /**
  -     * setFeature
  -     * 
  -     * @param featureId 
  -     * @param state 
  -     */
  -    public void setFeature(String featureId, boolean state)
  -        throws XMLConfigurationException {
  -
  -        super.setFeature(featureId, state);
  -            
  -        if (featureId.equals(VALIDATION)) {
  -            fValidation = state;
  -        }
  -
  -    } // setFeature
  -
  -    /**
        * Returns a list of property identifiers that are recognized by
        * this component. This method may return null if no properties
        * are recognized by this component.
  @@ -377,19 +380,6 @@
       public String[] getRecognizedProperties() {
           return RECOGNIZED_PROPERTIES;
       } // getRecognizedProperties():String[]
  -
  -    /**
  -     * setProperty
  -     * 
  -     * @param propertyId 
  -     * @param value 
  -     */
  -    public void setProperty(String propertyId, Object value)
  -        throws XMLConfigurationException {
  -        
  -        super.setProperty(propertyId, value);
  -
  -    } // setProperty
   
       //
       // XMLDTDSource methods
  
  
  
  1.3       +29 -7     xml-xerces/java/src/org/apache/xerces/impl/XMLDocumentScannerImpl.java
  
  Index: XMLDocumentScannerImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/XMLDocumentScannerImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XMLDocumentScannerImpl.java	2001/08/23 00:35:21	1.2
  +++ XMLDocumentScannerImpl.java	2001/08/23 08:09:02	1.3
  @@ -92,10 +92,14 @@
    * component manager that uses it:
    * <ul>
    *  <li>http://xml.org/sax/features/namespaces</li>
  + *  <li>http://xml.org/sax/features/validation</li>
  + *  <li>http://apache.org/xml/features/nonvalidating/load-external-dtd</li>
    *  <li>http://apache.org/xml/features/scanner/notify-char-refs</li>
  + *  <li>http://apache.org/xml/features/scanner/notify-builtin-refs</li>
    *  <li>http://apache.org/xml/properties/internal/symbol-table</li>
    *  <li>http://apache.org/xml/properties/internal/error-reporter</li>
    *  <li>http://apache.org/xml/properties/internal/entity-manager</li>
  + *  <li>http://apache.org/xml/properties/internal/dtd-scanner</li>
    * </ul>
    *
    * @author Glenn Marcy, IBM
  @@ -104,7 +108,7 @@
    * @author Arnaud  Le Hors, IBM
    * @author Eric Ye, IBM
    *
  - * @version $Id: XMLDocumentScannerImpl.java,v 1.2 2001/08/23 00:35:21 lehors Exp $
  + * @version $Id: XMLDocumentScannerImpl.java,v 1.3 2001/08/23 08:09:02 andyc Exp $
    */
   public class XMLDocumentScannerImpl
       extends XMLScanner
  @@ -191,15 +195,18 @@
   
       /** Recognized features. */
       private static final String[] RECOGNIZED_FEATURES = {
  -        VALIDATION, 
           NAMESPACES, 
  +        VALIDATION, 
           LOAD_EXTERNAL_DTD,
  -        NOTIFY_CHAR_REFS, 
           NOTIFY_BUILTIN_REFS,
  +        NOTIFY_CHAR_REFS, 
       };
   
       /** Recognized properties. */
       private static final String[] RECOGNIZED_PROPERTIES = {
  +        SYMBOL_TABLE,
  +        ERROR_REPORTER,
  +        ENTITY_MANAGER,
           DTD_SCANNER,
       };
   
  @@ -276,6 +283,7 @@
       /** Namespaces. */
       protected boolean fNamespaces;
   
  +    /** Load external DTD. */
       protected boolean fLoadExternalDTD = true;
   
       /** Notify built-in references. */
  @@ -409,16 +417,30 @@
           fDoctypeSystemId = null;
   
           // sax features
  -        fNamespaces = componentManager.getFeature(NAMESPACES);
  +        try {
  +            fNamespaces = componentManager.getFeature(NAMESPACES);
  +        }
  +        catch (XMLConfigurationException e) {
  +            fNamespaces = true;
  +        }
           fAttributes.setNamespaces(fNamespaces);
   
           // xerces features
  -        fNotifyBuiltInRefs = componentManager.getFeature(NOTIFY_BUILTIN_REFS);
  +        try {
  +            fNotifyBuiltInRefs = componentManager.getFeature(NOTIFY_BUILTIN_REFS);
  +        }
  +        catch (XMLConfigurationException e) {
  +            fNotifyBuiltInRefs = false;
  +        }
  +        try {
  +            fLoadExternalDTD = componentManager.getFeature(LOAD_EXTERNAL_DTD);
  +        }
  +        catch (XMLConfigurationException e) {
  +            fLoadExternalDTD = true;
  +        }
   
           // xerces properties
           fDTDScanner = (XMLDTDScanner)componentManager.getProperty(DTD_SCANNER);
  -
  -        fLoadExternalDTD = componentManager.getFeature(LOAD_EXTERNAL_DTD);
   
           // initialize vars
           fMarkupDepth = 0;
  
  
  
  1.3       +72 -46    xml-xerces/java/src/org/apache/xerces/impl/XMLEntityManager.java
  
  Index: XMLEntityManager.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/XMLEntityManager.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XMLEntityManager.java	2001/08/23 00:35:21	1.2
  +++ XMLEntityManager.java	2001/08/23 08:09:02	1.3
  @@ -104,9 +104,9 @@
    *  <li>http://xml.org/sax/features/external-general-entities</li>
    *  <li>http://xml.org/sax/features/external-parameter-entities</li>
    *  <li>http://apache.org/xml/features/allow-java-encodings</li>
  - *  <li>http://apache.org/xml/properties/internal/entity-resolver</li>
    *  <li>http://apache.org/xml/properties/internal/symbol-table</li>
    *  <li>http://apache.org/xml/properties/internal/error-reporter</li>
  + *  <li>http://apache.org/xml/properties/internal/entity-resolver</li>
    * </ul>
    *
    *
  @@ -114,7 +114,7 @@
    * @author Andy Clark, IBM
    * @author Arnaud  Le Hors, IBM
    *
  - * @version $Id: XMLEntityManager.java,v 1.2 2001/08/23 00:35:21 lehors Exp $
  + * @version $Id: XMLEntityManager.java,v 1.3 2001/08/23 08:09:02 andyc Exp $
    */
   public class XMLEntityManager
       implements XMLComponent {
  @@ -146,10 +146,6 @@
   
       // property identifiers
   
  -    /** Property identifier: entity resolver. */
  -    protected static final String ENTITY_RESOLVER = 
  -        Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_RESOLVER_PROPERTY;
  -
       /** Property identifier: symbol table. */
       protected static final String SYMBOL_TABLE = 
           Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
  @@ -158,18 +154,25 @@
       protected static final String ERROR_REPORTER = 
           Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
   
  +    /** Property identifier: entity resolver. */
  +    protected static final String ENTITY_RESOLVER = 
  +        Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_RESOLVER_PROPERTY;
  +
       // recognized features and properties
   
       /** Recognized features. */
       private static final String[] RECOGNIZED_FEATURES = {
  -        VALIDATION,                     EXTERNAL_GENERAL_ENTITIES,
  -        EXTERNAL_PARAMETER_ENTITIES,    ALLOW_JAVA_ENCODINGS,
  +        VALIDATION,                     
  +        EXTERNAL_GENERAL_ENTITIES,
  +        EXTERNAL_PARAMETER_ENTITIES,    
  +        ALLOW_JAVA_ENCODINGS,
       };
   
       /** Recognized properties. */
       private static final String[] RECOGNIZED_PROPERTIES = {
  -        ENTITY_RESOLVER,    SYMBOL_TABLE,
  +        SYMBOL_TABLE,
           ERROR_REPORTER,
  +        ENTITY_RESOLVER,    
       };
   
       // debugging
  @@ -197,34 +200,6 @@
       // features
   
       /** 
  -     * Buffer size. This feature does not have a feature identifier, yet. 
  -     * Should it?
  -     */
  -    protected int fBufferSize = DEFAULT_BUFFER_SIZE;
  -
  -    // properties
  -
  -    /** 
  -     * Entity resolver. This property identifier is:
  -     * http://apache.org/xml/properties/internal/entity-resolver
  -     */
  -    protected XMLEntityResolver fEntityResolver;
  -
  -    /** 
  -     * Symbol table. This property identifier is:
  -     * http://apache.org/xml/properties/internal/symbol-table
  -     */
  -    protected SymbolTable fSymbolTable;
  -
  -    /**
  -     * Error reporter. This property identifier is:
  -     * http://apache.org/xml/properties/internal/error-reporter
  -     */
  -    protected XMLErrorReporter fErrorReporter;
  -
  -    // features
  -
  -    /** 
        * Validation. This feature identifier is:
        * http://xml.org/sax/features/validation
        */
  @@ -248,9 +223,35 @@
        */
       protected boolean fAllowJavaEncodings;
   
  +    // properties
  +
  +    /** 
  +     * Symbol table. This property identifier is:
  +     * http://apache.org/xml/properties/internal/symbol-table
  +     */
  +    protected SymbolTable fSymbolTable;
  +
  +    /**
  +     * Error reporter. This property identifier is:
  +     * http://apache.org/xml/properties/internal/error-reporter
  +     */
  +    protected XMLErrorReporter fErrorReporter;
  +
  +    /** 
  +     * Entity resolver. This property identifier is:
  +     * http://apache.org/xml/properties/internal/entity-resolver
  +     */
  +    protected XMLEntityResolver fEntityResolver;
  +
       // settings
   
       /** 
  +     * Buffer size. This feature does not have a feature identifier, yet. 
  +     * Should it?
  +     */
  +    protected int fBufferSize = DEFAULT_BUFFER_SIZE;
  +
  +    /** 
        * True if the document entity is standalone. This should really
        * only be set by the document source (e.g. XMLDocumentScanner).
        */
  @@ -788,17 +789,42 @@
           throws XMLConfigurationException {
   
           // sax features
  -        fValidation = componentManager.getFeature(VALIDATION);
  -        fExternalGeneralEntities = componentManager.getFeature(EXTERNAL_GENERAL_ENTITIES);
  -        fExternalParameterEntities = componentManager.getFeature(EXTERNAL_PARAMETER_ENTITIES);
  +        try {
  +            fValidation = componentManager.getFeature(VALIDATION);
  +        }
  +        catch (XMLConfigurationException e) {
  +            fValidation = false;
  +        }
  +        try {
  +            fExternalGeneralEntities = componentManager.getFeature(EXTERNAL_GENERAL_ENTITIES);
  +        }
  +        catch (XMLConfigurationException e) {
  +            fExternalGeneralEntities = true;
  +        }
  +        try {
  +            fExternalParameterEntities = componentManager.getFeature(EXTERNAL_PARAMETER_ENTITIES);
  +        }
  +        catch (XMLConfigurationException e) {
  +            fExternalParameterEntities = true;
  +        }
   
           // xerces features
  -        fAllowJavaEncodings = componentManager.getFeature(ALLOW_JAVA_ENCODINGS);
  +        try {
  +            fAllowJavaEncodings = componentManager.getFeature(ALLOW_JAVA_ENCODINGS);
  +        }
  +        catch (XMLConfigurationException e) {
  +            fAllowJavaEncodings = false;
  +        }
   
           // xerces properties
  -        fEntityResolver = (XMLEntityResolver)componentManager.getProperty(ENTITY_RESOLVER);
           fSymbolTable = (SymbolTable)componentManager.getProperty(SYMBOL_TABLE);
           fErrorReporter = (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER);
  +        try {
  +            fEntityResolver = (XMLEntityResolver)componentManager.getProperty(ENTITY_RESOLVER);
  +        }
  +        catch (XMLConfigurationException e) {
  +            fEntityResolver = null;
  +        }
   
           // initialize state
           fStandalone = false;
  @@ -894,16 +920,16 @@
           // Xerces properties
           if (propertyId.startsWith(Constants.XERCES_PROPERTY_PREFIX)) {
               String property = propertyId.substring(Constants.XERCES_PROPERTY_PREFIX.length());
  -            if (property.equals(Constants.ENTITY_RESOLVER_PROPERTY)) {
  -                fEntityResolver = (XMLEntityResolver)value;
  -                return;
  -            }
               if (property.equals(Constants.SYMBOL_TABLE_PROPERTY)) {
                   fSymbolTable = (SymbolTable)value;
                   return;
               }
               if (property.equals(Constants.ERROR_REPORTER_PROPERTY)) {
                   fErrorReporter = (XMLErrorReporter)value;
  +                return;
  +            }
  +            if (property.equals(Constants.ENTITY_RESOLVER_PROPERTY)) {
  +                fEntityResolver = (XMLEntityResolver)value;
                   return;
               }
           }
  
  
  
  1.3       +46 -28    xml-xerces/java/src/org/apache/xerces/impl/XMLScanner.java
  
  Index: XMLScanner.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/XMLScanner.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XMLScanner.java	2001/08/23 00:35:21	1.2
  +++ XMLScanner.java	2001/08/23 08:09:02	1.3
  @@ -83,22 +83,51 @@
    * This component requires the following features and properties from the
    * component manager that uses it:
    * <ul>
  + *  <li>http://xml.org/sax/features/validation</li>
  + *  <li>http://apache.org/xml/features/scanner/notify-char-refs</li>
    *  <li>http://apache.org/xml/properties/internal/symbol-table</li>
    *  <li>http://apache.org/xml/properties/internal/error-reporter</li>
    *  <li>http://apache.org/xml/properties/internal/entity-manager</li>
  - *  <li>http://apache.org/xml/features/scanner/notify-char-refs</li>
    * </ul>
    *
    * @author Andy Clark, IBM
    * @author Arnaud  Le Hors, IBM
    * @author Eric Ye, IBM
    *
  - * @version $Id: XMLScanner.java,v 1.2 2001/08/23 00:35:21 lehors Exp $
  + * @version $Id: XMLScanner.java,v 1.3 2001/08/23 08:09:02 andyc Exp $
    */
   public abstract class XMLScanner 
       implements XMLComponent {
   
       //
  +    // Constants
  +    //
  +
  +    // feature identifiers
  +
  +    /** Feature identifier: validation. */
  +    protected static final String VALIDATION =
  +        Constants.SAX_FEATURE_PREFIX + Constants.VALIDATION_FEATURE;
  +
  +    /** Feature identifier: notify character references. */
  +    protected static final String NOTIFY_CHAR_REFS =
  +        Constants.XERCES_FEATURE_PREFIX + Constants.NOTIFY_CHAR_REFS_FEATURE;
  +
  +    // property identifiers
  +
  +    /** Property identifier: symbol table. */
  +    protected static final String SYMBOL_TABLE = 
  +        Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
  +
  +    /** Property identifier: error reporter. */
  +    protected static final String ERROR_REPORTER = 
  +        Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
  +
  +    /** Property identifier: entity manager. */
  +    protected static final String ENTITY_MANAGER = 
  +        Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_MANAGER_PROPERTY;
  +
  +    //
       // Data
       //
   
  @@ -108,13 +137,19 @@
        * Validation. This feature identifier is:
        * http://xml.org/sax/features/validation
        */
  -    protected boolean fValidation;
  +    protected boolean fValidation = false;
       
  +    /** Character references notification. */
  +    protected boolean fNotifyCharRefs = false;
  +
       // properties
   
       /** Symbol table. */
       protected SymbolTable fSymbolTable;
   
  +    /** Error reporter. */
  +    protected XMLErrorReporter fErrorReporter;
  +
       /** Entity manager. */
       protected XMLEntityManager fEntityManager;
   
  @@ -137,14 +172,8 @@
   
       /** Array of 3 strings. */
       protected String[] fStrings = new String[3];
  -
  -    /** Error reporter. */
  -    protected XMLErrorReporter fErrorReporter;
   
  -    /** Character references resolution. */
  -    protected boolean fNotifyCharRefs = false;
  -
  -     /** Literal value of the last character refence scanned. */
  +    /** Literal value of the last character refence scanned. */
       protected String fCharRefLiteral = null;
   
       /** Attribute entity stack. */
  @@ -192,19 +221,6 @@
       /** Symbol: "apos". */
       protected String fAposSymbol;
   
  -    // feature identifiers
  -    protected static final String VALIDATION =
  -        Constants.SAX_FEATURE_PREFIX + Constants.VALIDATION_FEATURE;
  -    protected static final String NOTIFY_CHAR_REFS =
  -        Constants.XERCES_FEATURE_PREFIX + Constants.NOTIFY_CHAR_REFS_FEATURE;
  -
  -    // recognized features
  -    /** has to be declared in subclasses to avoid having to concatenate
  -    private static final String[] RECOGNIZED_FEATURES = {
  -        VALIDATION, NOTIFY_CHAR_REFS, 
  -    };
  -    /***/
  -
       //
       // XMLComponent methods
       //
  @@ -221,11 +237,8 @@
           throws XMLConfigurationException {
   
           // Xerces properties
  -        final String SYMBOL_TABLE = Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
           fSymbolTable = (SymbolTable)componentManager.getProperty(SYMBOL_TABLE);
  -        final String ERROR_REPORTER = Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
           fErrorReporter = (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER);
  -        final String ENTITY_MANAGER = Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_MANAGER_PROPERTY;
           fEntityManager = (XMLEntityManager)componentManager.getProperty(ENTITY_MANAGER);
   
           // initialize scanner
  @@ -245,12 +258,17 @@
           fAposSymbol = fSymbolTable.addSymbol("apos");
           
           // sax features
  -        fValidation = componentManager.getFeature(VALIDATION);
  +        try {
  +            fValidation = componentManager.getFeature(VALIDATION);
  +        }
  +        catch (XMLConfigurationException e) {
  +            fValidation = false;
  +        }
           try {
               fNotifyCharRefs = componentManager.getFeature(NOTIFY_CHAR_REFS);
           }
           catch (XMLConfigurationException e) {
  -            // ignore
  +            fNotifyCharRefs = false;
           }
   
       } // reset(XMLComponentManager)
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org