neilg       2003/01/07 14:23:48

  Modified:    java/src/org/apache/xerces/parsers AbstractSAXParser.java
                        DOMParser.java DOMBuilderImpl.java XMLParser.java
  Log:
  Fix a JAXP TCK failure.  Now, whenever an EntityResolver
  needs to be set on one of our parsers, the corresponding
  configuration's setProperty method is called instead of its setEntityResolver method 
as
  had formerly been the case.  This allows the new resolver to be
  passed to all registered components; BasicParserConfiguration's setEntityResolver 
method
  does not exhibit this behaviour.
  
  REVISIT:  BasicParserConfiguration's setEntityResolver (and setErrorHander)
  methods *should* in all likelihood exhibit this behaviour...
  
  Revision  Changes    Path
  1.37      +4 -3      
xml-xerces/java/src/org/apache/xerces/parsers/AbstractSAXParser.java
  
  Index: AbstractSAXParser.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xerces/java/src/org/apache/xerces/parsers/AbstractSAXParser.java,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- AbstractSAXParser.java    19 Dec 2002 19:17:37 -0000      1.36
  +++ AbstractSAXParser.java    7 Jan 2003 22:23:47 -0000       1.37
  @@ -1151,7 +1151,8 @@
       public void setEntityResolver(EntityResolver resolver) {
   
           try {
  -            fConfiguration.setEntityResolver(new EntityResolverWrapper(resolver));
  +            fConfiguration.setProperty(ENTITY_RESOLVER,
  +                                       new EntityResolverWrapper(resolver));
           }
           catch (XMLConfigurationException e) {
               // do nothing
  @@ -1171,7 +1172,7 @@
           EntityResolver entityResolver = null;
           try {
               XMLEntityResolver xmlEntityResolver =
  -                (XMLEntityResolver)fConfiguration.getEntityResolver();
  +                (XMLEntityResolver)fConfiguration.getProperty(ENTITY_RESOLVER);
               if (xmlEntityResolver != null &&
                   xmlEntityResolver instanceof EntityResolverWrapper) {
                   entityResolver = 
((EntityResolverWrapper)xmlEntityResolver).getEntityResolver();
  
  
  
  1.65      +5 -4      xml-xerces/java/src/org/apache/xerces/parsers/DOMParser.java
  
  Index: DOMParser.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/parsers/DOMParser.java,v
  retrieving revision 1.64
  retrieving revision 1.65
  diff -u -r1.64 -r1.65
  --- DOMParser.java    11 Dec 2002 16:14:31 -0000      1.64
  +++ DOMParser.java    7 Jan 2003 22:23:47 -0000       1.65
  @@ -2,7 +2,7 @@
    * The Apache Software License, Version 1.1
    *
    *
  - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -301,7 +301,8 @@
       public void setEntityResolver(EntityResolver resolver) {
   
           try {
  -            fConfiguration.setEntityResolver( new EntityResolverWrapper(resolver));
  +            fConfiguration.setProperty(ENTITY_RESOLVER, 
  +                                       new EntityResolverWrapper(resolver));
           }
           catch (XMLConfigurationException e) {
               // do nothing
  @@ -321,7 +322,7 @@
           EntityResolver entityResolver = null;
           try {
               XMLEntityResolver xmlEntityResolver = 
  -                (XMLEntityResolver)fConfiguration.getEntityResolver();
  +                (XMLEntityResolver)fConfiguration.getProperty(ENTITY_RESOLVER);
               if (xmlEntityResolver != null &&
                   xmlEntityResolver instanceof EntityResolverWrapper) {
                   entityResolver = 
((EntityResolverWrapper)xmlEntityResolver).getEntityResolver();
  
  
  
  1.27      +4 -4      
xml-xerces/java/src/org/apache/xerces/parsers/DOMBuilderImpl.java
  
  Index: DOMBuilderImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xerces/java/src/org/apache/xerces/parsers/DOMBuilderImpl.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- DOMBuilderImpl.java       31 Dec 2002 01:55:06 -0000      1.26
  +++ DOMBuilderImpl.java       7 Jan 2003 22:23:47 -0000       1.27
  @@ -2,7 +2,7 @@
    * The Apache Software License, Version 1.1
    *
    *
  - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -403,7 +403,7 @@
                        else if (name.equals(Constants.DOM_ENTITY_RESOLVER)) {
                                if (value instanceof DOMEntityResolver) {
                                        try {
  -                        fConfiguration.setEntityResolver(new 
DOMEntityResolverWrapper((DOMEntityResolver) value));
  +                        fConfiguration.setProperty(ENTITY_RESOLVER, new 
DOMEntityResolverWrapper((DOMEntityResolver) value));
                                        }
                                        catch (XMLConfigurationException e) {}
                                }
  @@ -564,7 +564,7 @@
                else if (name.equals(Constants.DOM_ENTITY_RESOLVER)) {
                        try {               
                   XMLEntityResolver entityResolver = 
  -               (XMLEntityResolver) fConfiguration.getEntityResolver();
  +               (XMLEntityResolver) fConfiguration.getProperty(ENTITY_RESOLVER);
                   if (entityResolver != null
                       && entityResolver instanceof DOMEntityResolverWrapper) {
                       return ((DOMEntityResolverWrapper) 
entityResolver).getEntityResolver();
  
  
  
  1.8       +6 -2      xml-xerces/java/src/org/apache/xerces/parsers/XMLParser.java
  
  Index: XMLParser.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/parsers/XMLParser.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XMLParser.java    11 Dec 2002 16:14:31 -0000      1.7
  +++ XMLParser.java    7 Jan 2003 22:23:47 -0000       1.8
  @@ -2,7 +2,7 @@
    * The Apache Software License, Version 1.1
    *
    *
  - * Copyright (c) 1999-2002 The Apache Software Foundation.  
  + * Copyright (c) 1999-2003 The Apache Software Foundation.  
    * All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -95,6 +95,9 @@
   
       // properties
   
  +    /** Property identifier: entity resolver. */
  +    protected static final String ENTITY_RESOLVER = 
  +        Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_RESOLVER_PROPERTY;
   
       /** Property identifier: error handler. */
       protected static final String ERROR_HANDLER = 
  @@ -102,6 +105,7 @@
   
       /** Recognized properties. */
       private static final String[] RECOGNIZED_PROPERTIES = {
  +        ENTITY_RESOLVER,
           ERROR_HANDLER,
       };
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to