You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by sa...@apache.org on 2002/04/19 19:15:38 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/util EntityResolverWrapper.java

sandygao    02/04/19 10:15:37

  Modified:    java/src/org/apache/xerces/util EntityResolverWrapper.java
  Log:
  When both pubId and sysId are null, the user's entity resolver can do nothing
  about it. We'd better not bother calling it. This happens when the
  resourceIdentifier is a GrammarDescription, which describes a schema
  grammar of some namespace, but without any schema location hint.
  
  Revision  Changes    Path
  1.5       +13 -4     xml-xerces/java/src/org/apache/xerces/util/EntityResolverWrapper.java
  
  Index: EntityResolverWrapper.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/util/EntityResolverWrapper.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- EntityResolverWrapper.java	29 Jan 2002 01:15:18 -0000	1.4
  +++ EntityResolverWrapper.java	19 Apr 2002 17:15:37 -0000	1.5
  @@ -77,7 +77,7 @@
    *
    * @author Andy Clark, IBM
    * 
  - * @version $Id: EntityResolverWrapper.java,v 1.4 2002/01/29 01:15:18 lehors Exp $
  + * @version $Id: EntityResolverWrapper.java,v 1.5 2002/04/19 17:15:37 sandygao Exp $
    */
   public class EntityResolverWrapper
       implements XMLEntityResolver {
  @@ -132,11 +132,20 @@
       public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
           throws XNIException, IOException {
   
  +        // When both pubId and sysId are null, the user's entity resolver
  +        // can do nothing about it. We'd better not bother calling it.
  +        // This happens when the resourceIdentifier is a GrammarDescription,
  +        // which describes a schema grammar of some namespace, but without
  +        // any schema location hint. -Sg
  +        String pubId = resourceIdentifier.getPublicId();
  +        String sysId = resourceIdentifier.getExpandedSystemId();
  +        if (pubId == null && sysId == null)
  +            return null;
  +
           // resolve entity using SAX entity resolver
           if (fEntityResolver != null && resourceIdentifier != null) {
               try {
  -                InputSource inputSource = 
  -                    fEntityResolver.resolveEntity(resourceIdentifier.getPublicId(), resourceIdentifier.getExpandedSystemId());
  +                InputSource inputSource = fEntityResolver.resolveEntity(pubId, sysId);
                   if (inputSource != null) {
                       String publicId = inputSource.getPublicId();
                       String systemId = inputSource.getSystemId();
  @@ -167,4 +176,4 @@
           return null;
   
       } // resolveEntity(String,String,String):XMLInputSource
  -    }
  +}
  
  
  

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