You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bo...@apache.org on 2002/11/08 10:53:22 UTC

cvs commit: jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/optional XsltTest.java

bodewig     2002/11/08 01:53:22

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional
                        XMLValidateTask.java
               src/main/org/apache/tools/ant/types DTDLocation.java
                        EntityLocation.java ResourceLocation.java
                        XMLCatalog.java
               src/main/org/apache/tools/ant/types/resolver
                        ApacheCatalog.java ApacheCatalogResolver.java
               src/testcases/org/apache/tools/ant/taskdefs/optional
                        XsltTest.java
  Log:
  re-enable tests that failed after the first iteration of Craeg's
  resolver patch.
  
  Submitted by:	Craeg K Strong <cs...@arielpartners.com>
  
  Revision  Changes    Path
  1.28      +3 -3      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java
  
  Index: XMLValidateTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- XMLValidateTask.java	30 Sep 2002 09:40:39 -0000	1.27
  +++ XMLValidateTask.java	8 Nov 2002 09:53:21 -0000	1.28
  @@ -65,7 +65,7 @@
   import org.apache.tools.ant.DirectoryScanner;
   import org.apache.tools.ant.Project;
   import org.apache.tools.ant.Task;
  -import org.apache.tools.ant.types.DTDLocation;
  +import org.apache.tools.ant.types.ResourceLocation;
   import org.apache.tools.ant.types.FileSet;
   import org.apache.tools.ant.types.Path;
   import org.apache.tools.ant.types.Reference;
  @@ -248,8 +248,8 @@
        * This stores the location of a DTD. The DTD is identified
        * by its public Id.
        */
  -    public DTDLocation createDTD() {
  -        DTDLocation dtdLocation = new DTDLocation();
  +    public ResourceLocation createDTD() {
  +        ResourceLocation dtdLocation = new ResourceLocation();
           xmlCatalog.addDTD(dtdLocation);
           return dtdLocation;
       }
  
  
  
  1.4       +1 -6      jakarta-ant/src/main/org/apache/tools/ant/types/DTDLocation.java
  
  Index: DTDLocation.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/DTDLocation.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DTDLocation.java	5 Nov 2002 16:33:28 -0000	1.3
  +++ DTDLocation.java	8 Nov 2002 09:53:21 -0000	1.4
  @@ -70,9 +70,4 @@
    * @version $Id$
    */
   public class DTDLocation extends ResourceLocation {
  -
  -    public DTDLocation() {
  -        super("PUBLIC");
  -    }
  -
   }
  
  
  
  1.2       +0 -5      jakarta-ant/src/main/org/apache/tools/ant/types/EntityLocation.java
  
  Index: EntityLocation.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/EntityLocation.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EntityLocation.java	5 Nov 2002 16:33:28 -0000	1.1
  +++ EntityLocation.java	8 Nov 2002 09:53:21 -0000	1.2
  @@ -69,9 +69,4 @@
    * @author <a href="mailto:cstrong@arielpartners.com">Craeg Strong</a>
    */
   public class EntityLocation extends ResourceLocation {
  -
  -    public EntityLocation() {
  -        super("URI");
  -    }
  -
   }
  
  
  
  1.2       +7 -18     jakarta-ant/src/main/org/apache/tools/ant/types/ResourceLocation.java
  
  Index: ResourceLocation.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/ResourceLocation.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ResourceLocation.java	5 Nov 2002 16:33:28 -0000	1.1
  +++ ResourceLocation.java	8 Nov 2002 09:53:21 -0000	1.2
  @@ -76,6 +76,9 @@
    * @author <a href="mailto:cstrong@arielpartners.com">Craeg Strong</a>
    * @version $Id$
    */
  +
  +import java.net.URL;
  +
   public class ResourceLocation {
   
       //-- Fields ----------------------------------------------------------------
  @@ -98,14 +101,10 @@
        * for an external catalog file is the directory in which it is
        * located.
        */
  -    private String base = null;
  +    private URL base = null;
   
       //-- Methods ---------------------------------------------------------------
   
  -    protected ResourceLocation(String name) {
  -        this.name = name;
  -    }
  -   
       /**
        * @param publicId uniquely identifies the resource.
        */
  @@ -127,7 +126,7 @@
        * it is resolved using the base.  The default base for an
        * external catalog file is the directory in which it is located.
        */
  -    public void setBase(String base) {
  +    public void setBase(URL base) {
           this.base = base;
       }
   
  @@ -148,18 +147,8 @@
       /**
        * @return the base of the resource identified by the publicId.
        */
  -    public String getBase() {
  +    public URL getBase() {
           return base;
  -    }
  -
  -    /**
  -     * @return the name of the catalog entry type.  Currently this is
  -     * one of <code>PUBLIC</code> or <code>URI</code>.
  -     * 
  -     * @see org.apache.xml.resolver.Catalog
  -     */
  -    public String getName() {
  -        return name;
       }
   
   } //-- ResourceLocation
  
  
  
  1.17      +174 -168  jakarta-ant/src/main/org/apache/tools/ant/types/XMLCatalog.java
  
  Index: XMLCatalog.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/XMLCatalog.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- XMLCatalog.java	5 Nov 2002 16:33:28 -0000	1.16
  +++ XMLCatalog.java	8 Nov 2002 09:53:21 -0000	1.17
  @@ -76,7 +76,7 @@
   import org.apache.tools.ant.BuildException;
   import org.apache.tools.ant.DirectoryScanner;
   import org.apache.tools.ant.Project;
  -import org.apache.tools.ant.util.FileUtils;
  +import org.apache.tools.ant.util.JAXPUtils;
   import org.xml.sax.EntityResolver;
   import org.xml.sax.InputSource;
   import org.xml.sax.SAXException;
  @@ -95,6 +95,19 @@
    * in the <a href="http://java.sun.com/xml/jaxp">Java API for XML
    * Processing Specification</a>.</p>
    *
  + * <p>Resource locations can be specified either in-line or in
  + * external catalog file(s), or both.  In order to use an external
  + * catalog file, the xml-commons resolver library ("resolver.jar")
  + * must be in your classpath.  External catalog files may be either <a
  + * href="http://oasis-open.org/committees/entity/background/9401.html">
  + * plain text format</a> or <a
  + * href="http://www.oasis-open.org/committees/entity/spec-2001-08-06.html">
  + * XML format</a>.  If the xml-commons resolver library is not found
  + * in the classpath, external catalog files, specified in
  + * <code>&lt;catalogfiles&gt;</code> filesets, will be ignored and a
  + * warning will be logged.  In this case, however, processing of
  + * inline entries will proceed normally.</p>
  + *
    * <p>Currently, only <code>&lt;dtd&gt;</code> and
    * <code>&lt;entity&gt;</code> elements may be specified inline; these
    * correspond to OASIS catalog entry types <code>PUBLIC</code> and
  @@ -108,6 +121,8 @@
    * &nbsp;&nbsp;&lt;dtd publicId="" location="/path/to/file2.jar" /&gt;<br>
    * &nbsp;&nbsp;&lt;entity publicId="" location="/path/to/file3.jar" /&gt;<br>
    * &nbsp;&nbsp;&lt;entity publicId="" location="/path/to/file4.jar" /&gt;<br>
  + * &nbsp;&nbsp;&lt;catalogfiles dir="${basedir}" includes="**\catalog" /&gt;<br>
  + * &nbsp;&nbsp;&lt;catalogfiles dir="/opt/catalogs/" includes="**\catalog.xml" /&gt;<br>
    * &lt;/xmlcatalog&gt;<br>
    * </code>
    * <p>
  @@ -123,6 +138,7 @@
    * <ol>
    * <li>In the local filesystem</li>
    * <li>In the classpath</li>
  + * <li>Using the Apache xml-commons resolver (if it is available)</li>
    * <li>In URL-space</li>
    * </ol>
    * </p>
  @@ -133,8 +149,7 @@
    * support for XMLCatalogs.</p>
    *
    * <p>Possible future extension could provide for additional OASIS
  - * entry types to be specified inline, and external catalog files
  - * using the xml-commons resolver library</p>
  + * entry types to be specified inline.</p>
    *
    * @author dIon Gillard
    * @author Erik Hatcher
  @@ -143,8 +158,6 @@
    */
   public class XMLCatalog extends DataType 
       implements Cloneable, EntityResolver, URIResolver {
  -    /** File utilities instance */
  -    private FileUtils fileUtils = FileUtils.newFileUtils();
   
       //-- Fields ----------------------------------------------------------------
   
  @@ -171,10 +184,10 @@
       }
   
       /**
  -     * Returns the elements of the catalog - ResolverLocation and FileSet
  +     * Returns the elements of the catalog - ResourceLocation and FileSet
        * objects.
        *
  -     * @return the elements of the catalog - ResolverLocation and FileSet
  +     * @return the elements of the catalog - ResourceLocation and FileSet
        * objects
        */
       private Vector getElements() {
  @@ -255,10 +268,11 @@
           setChecked( false );
       }
   
  -    /** Creates the nested <code>&lt;catalogfiles&gt;</code> element.  Not
  -     * allowed if this catalog is itself a reference to another catalog -- that
  -     * is, a catalog cannot both refer to another <em>and</em> contain elements
  -     * or other attributes.
  +    /** 
  +     * Creates the nested <code>&lt;catalogfiles&gt;</code> element.
  +     * Not allowed if this catalog is itself a reference to another
  +     * catalog -- that is, a catalog cannot both refer to another
  +     * <em>and</em> contain elements or other attributes.
        *
        * @param fs the fileset of external catalogs.
        * @exception BuildException
  @@ -290,9 +304,6 @@
           getElements().addElement(dtd);
           setChecked( false );
       }
  -    public void addDTD(DTDLocation dtd) throws BuildException {
  -        addDTD((ResourceLocation)dtd);
  -    }
   
       /**
        * Creates the nested <code>&lt;entity&gt;</code> element.    Not
  @@ -300,34 +311,13 @@
        * catalog -- that is, a catalog cannot both refer to another
        * <em>and</em> contain elements or other attributes.
        *
  -     * @param entity the information about the URI resource mapping to
  -     * be added to the catalog.
  +     * @param entity the information about the URI resource mapping to be
  +     *       added to the catalog.
        * @exception BuildException if this is a reference and no nested
        *       elements are allowed.
        */
  -    public void addEntity(EntityLocation entity) throws BuildException {
  -        if (isReference()) {
  -            throw noChildrenAllowed();
  -        }
  -        getElements().addElement(entity);
  -    }
  -
  -    /**
  -     * Creates the nested <code>&lt;entity&gt;</code> element.    Not
  -     * allowed if this catalog is itself a reference to another
  -     * catalog -- that is, a catalog cannot both refer to another
  -     * <em>and</em> contain elements or other attributes.
  -     *
  -     * @param entity the information about the URI resource mapping to
  -     * be added to the catalog.
  -     * @exception BuildException if this is a reference and no nested
  -     *       elements are allowed.
  -     */
  -    public void addEntity(DTDLocation entity) throws BuildException {
  -        if (isReference()) {
  -            throw noChildrenAllowed();
  -        }
  -        getElements().addElement(entity);
  +    public void addEntity(ResourceLocation entity) throws BuildException {
  +        addDTD(entity);
       }
   
       /**
  @@ -432,12 +422,12 @@
           }
   
           SAXSource source = null;
  -
  +        
           String uri = removeFragment(href);
   
           log("resolve: '" + uri + "' with base: '" + base + "'", Project.MSG_DEBUG);
   
  -        source = resolveImpl(uri, base);
  +        source = (SAXSource)getCatalogResolver().resolve(uri, base);
   
           if (source == null) {
               log("No matching catalog entry found, parser will use: '" +
  @@ -447,12 +437,17 @@
               // setEntityResolver (see setEntityResolver javadoc comment)
               //
               source = new SAXSource();
  -            try
  -                {
  -                    URL baseURL = new URL(base);
  -                    URL url = (uri.length() == 0 ? baseURL : new URL(baseURL, uri));
  -                    source.setInputSource(new InputSource(url.toString()));
  +            URL baseURL = null;
  +            try {
  +                if (base == null) {
  +                    baseURL = getProject().getBaseDir().toURL();
  +                }
  +                else {
  +                    baseURL = new URL(base);
                   }
  +                URL url = (uri.length() == 0 ? baseURL : new URL(baseURL, uri));
  +                source.setInputSource(new InputSource(url.toString()));
  +            }
               catch (MalformedURLException ex) {
                   // At this point we are probably in failure mode, but
                   // try to use the bare URI as a last gasp
  @@ -467,7 +462,7 @@
       /**
        * The instance of the CatalogResolver strategy to use.
        */
  -    private static CatalogResolver catalogResolver = null;
  +    private CatalogResolver catalogResolver = null;
   
       /**
        * Factory method for creating the appropriate CatalogResolver
  @@ -478,11 +473,6 @@
        * appropriate implementation of CatalogResolver based on the answer.</p>
        * <p>This is an application of the Gang of Four Strategy Pattern
        * combined with Template Method.</p>
  -     *
  -     * @param publicId the publicId of the Resource for which local information
  -     *        is required
  -     * @return a ResourceLocation instance with information on the local location
  -     *         of the Resource or null if no such information is available
        */
       private CatalogResolver getCatalogResolver() {
   
  @@ -490,7 +480,7 @@
   
               AntClassLoader loader = null;
   
  -            loader = new AntClassLoader(project, Path.systemClasspath);
  +            loader = new AntClassLoader(getProject(), Path.systemClasspath);
   
               try {
                   Class clazz = loader.forceLoadSystemClass(APACHE_RESOLVER);
  @@ -525,7 +515,6 @@
           return catalogResolver;
       }
   
  -
       /**
        * <p>This is called from the URIResolver to set an EntityResolver
        * on the SAX parser to be used for new XML documents that are
  @@ -568,8 +557,8 @@
       /**
        * Find a ResourceLocation instance for the given publicId.
        *
  -     * @param publicId the publicId of the Resource for which local information is 
  -     *        required.
  +     * @param publicId the publicId of the Resource for which local information
  +     *        is required.
        * @return a ResourceLocation instance with information on the local location 
        *         of the Resource or null if no such information is available.
        */
  @@ -616,32 +605,54 @@
       private InputSource filesystemLookup(ResourceLocation matchingEntry) {
   
           String uri = matchingEntry.getLocation();
  +        URL baseURL = null;
   
           //
           // The ResourceLocation may specify a relative path for its
           // location attribute.  This is resolved using the appropriate
           // base.
           //
  -        File resFile = getProject().resolveFile(uri);
  -        InputSource source = null;
  -
  -        if (resFile.exists() && resFile.canRead()) {
  +        if (matchingEntry.getBase() != null) {
  +            baseURL = matchingEntry.getBase();
  +        } else {
               try {
  -                source = new InputSource(new FileInputStream(resFile));
  -                URL resFileURL = fileUtils.getFileURL(resFile);
  -                String sysid = resFileURL.toExternalForm();
  -                source.setSystemId(sysid);
  -                log("catalog entry matched a readable file: '" +
  -                    sysid + "'", Project.MSG_DEBUG);
  -            } catch(FileNotFoundException ex) {
  -                // ignore
  -            } catch(MalformedURLException ex) {
  -                // ignore
  -            } catch(IOException ex) {
  -                // ignore
  +                baseURL = getProject().getBaseDir().toURL();                
  +            }
  +            catch (MalformedURLException ex) {
  +                throw new BuildException("Project basedir cannot be converted to a URL");
  +            }
  +        }
  +        
  +        InputSource source = null;
  +        URL url = null;
  +        
  +        try {
  +            url = new URL(baseURL, uri);
  +        }
  +        catch (MalformedURLException ex) {
  +            // ignore
  +        }
  +        
  +        if (url != null) {
  +            String fileName = url.getFile();
  +            if (fileName != null) {
  +                log("fileName"+fileName, Project.MSG_DEBUG);
  +                File resFile = new File(fileName);
  +                if (resFile.exists() && resFile.canRead()) {
  +                    try {
  +                        source = new InputSource(new FileInputStream(resFile));
  +                        String sysid = JAXPUtils.getSystemId(resFile);
  +                        source.setSystemId(sysid);
  +                        log("catalog entry matched a readable file: '" +
  +                            sysid + "'", Project.MSG_DEBUG);
  +                    } catch(FileNotFoundException ex) {
  +                        // ignore
  +                    } catch(IOException ex) {
  +                        // ignore
  +                    }
  +                }
               }
           }
  -
           return source;
       }
   
  @@ -686,19 +697,32 @@
        * @return An InputSource for reading the resource, or <code>null</code>
        *    if the resource does not identify a valid URL or is not readable.
        */
  -    private InputSource urlLookup(String uri, String base) {
  +    private InputSource urlLookup(ResourceLocation matchingEntry) {
  +        
  +        String uri = matchingEntry.getLocation();
  +        URL baseURL = null;
  +
  +        //
  +        // The ResourceLocation may specify a relative url for its
  +        // location attribute.  This is resolved using the appropriate
  +        // base.
  +        //
  +        if (matchingEntry.getBase() != null) {
  +            baseURL = matchingEntry.getBase();
  +        } else {
  +            try {
  +                baseURL = getProject().getBaseDir().toURL();
  +            }
  +            catch (MalformedURLException ex) {
  +                throw new BuildException("Project basedir cannot be converted to a URL");
  +            }
  +        }
   
           InputSource source = null;
           URL url = null;
   
           try {
  -            if (base == null) {
  -                url = new URL(uri);
  -            }
  -            else {
  -                URL baseURL = new URL(base);
  -                url = (uri.length() == 0 ? baseURL : new URL(baseURL, uri));
  -            }
  +            url = new URL(baseURL, uri);
           }
           catch (MalformedURLException ex) {
               // ignore
  @@ -724,71 +748,6 @@
       }
   
       /**
  -     * Implements the guts of the resolveEntity() lookup strategy.
  -     */
  -    /*
  -      private InputSource resolveEntityImpl(String publicId) {
  -
  -      InputSource result = null;
  -
  -      ResourceLocation matchingEntry = findMatchingEntry(publicId);
  -
  -      if (matchingEntry != null) {
  -
  -      log("Matching catalog entry found for publicId: '" +
  -      matchingEntry.getPublicId() + "' location: '" +
  -      matchingEntry.getLocation() + "'",
  -      Project.MSG_DEBUG);
  -
  -      result = filesystemLookup(matchingEntry);
  -
  -      if (result == null) {
  -      result = classpathLookup(matchingEntry);
  -      }
  -
  -      if (result == null) {
  -      result = urlLookup(matchingEntry.getLocation(), null);
  -      }
  -      }
  -      return result;
  -      }
  -    */
  -
  -    /**
  -     * Implements the guts of the resolve() lookup strategy.
  -     */
  -    private SAXSource resolveImpl(String href, String base) {
  -
  -        SAXSource result = null;
  -        InputSource source = null;
  -
  -        ResourceLocation matchingEntry = findMatchingEntry(href);
  -
  -        if (matchingEntry != null) {
  -
  -            log("Matching catalog entry found for uri: '" +
  -                matchingEntry.getPublicId() + "' location: '" +
  -                matchingEntry.getLocation() + "'",
  -                Project.MSG_DEBUG);
  -
  -            source = filesystemLookup(matchingEntry);
  -
  -            if (source == null) {
  -                source = classpathLookup(matchingEntry);
  -            }
  -
  -            if (source == null) {
  -                source = urlLookup(matchingEntry.getLocation(), base);
  -            }
  -
  -            if (source != null) {
  -                result = new SAXSource(source);
  -            }
  -        }
  -        return result;
  -    }
  -
  -    /**
        * Interface implemented by both the InternalResolver strategy and
        * the ApacheResolver strategy.
        */
  @@ -815,9 +774,7 @@
   
           public InputSource resolveEntity(String publicId,
                                            String systemId) {
  -
               InputSource result = null;
  -
               ResourceLocation matchingEntry = findMatchingEntry(publicId);
   
               if (matchingEntry != null) {
  @@ -834,14 +791,12 @@
                   }
   
                   if (result == null) {
  -                    result = urlLookup(matchingEntry.getLocation(), null);
  +                    result = urlLookup(matchingEntry);
                   }
               }
               return result;
           }
   
  -
  -
           public Source resolve(String href, String base)
               throws TransformerException {
   
  @@ -857,14 +812,38 @@
                       matchingEntry.getLocation() + "'",
                       Project.MSG_DEBUG);
   
  -                source = filesystemLookup(matchingEntry);
  +                //
  +                // Use the passed in base in preference to the base
  +                // from matchingEntry, which is either null or the
  +                // directory in which the external catalog file from
  +                // which it was obtained is located.  We make a copy
  +                // so matchingEntry's original base is untouched.
  +                //
  +                // This is the standard behavior as per my reading of
  +                // the JAXP and XML Catalog specs.  CKS 11/7/2002
  +                // 
  +                ResourceLocation entryCopy = matchingEntry;
  +                if (base != null) {
  +                    try {
  +                        URL baseURL = new URL(base);
  +                        entryCopy = new ResourceLocation();
  +                        entryCopy.setBase(baseURL);
  +                    }
  +                    catch (MalformedURLException ex) {
  +                        // ignore
  +                    }
  +                }
  +                entryCopy.setPublicId(matchingEntry.getPublicId());
  +                entryCopy.setLocation(matchingEntry.getLocation());
  +
  +                source = filesystemLookup(entryCopy);
   
                   if (source == null) {
  -                    source = classpathLookup(matchingEntry);
  +                    source = classpathLookup(entryCopy);
                   }
   
                   if (source == null) {
  -                    source = urlLookup(matchingEntry.getLocation(), base);
  +                    source = urlLookup(entryCopy);
                   }
   
                   if (source != null) {
  @@ -971,11 +950,11 @@
               else {
                   //
                   // We didn't match a ResourceLocation, but since we
  -                // only support PUBLIC and URI entry types, it is
  -                // still possible that there is another entry in an
  -                // external catalog that will match.  We call Apache
  -                // resolver's resolveEntity method to cover this
  -                // possibility.
  +                // only support PUBLIC and URI entry types internally,
  +                // it is still possible that there is another entry in
  +                // an external catalog that will match.  We call
  +                // Apache resolver's resolveEntity method to cover
  +                // this possibility.
                   //
                   try {
                       result = 
  @@ -1008,10 +987,36 @@
                       matchingEntry.getLocation() + "'",
                       Project.MSG_DEBUG);
   
  -                source = filesystemLookup(matchingEntry);
  +                //
  +                // Use the passed in base in preference to the base
  +                // from matchingEntry, which is either null or the
  +                // directory in which the external catalog file from
  +                // which it was obtained is located.  We make a copy
  +                // so matchingEntry's original base is untouched.  Of
  +                // course, if there is no base, no need to make a
  +                // copy...
  +                //
  +                // This is the standard behavior as per my reading of
  +                // the JAXP and XML Catalog specs.  CKS 11/7/2002
  +                // 
  +                ResourceLocation entryCopy = matchingEntry;
  +                if (base != null) {
  +                    try {
  +                        URL baseURL = new URL(base);
  +                        entryCopy = new ResourceLocation();
  +                        entryCopy.setBase(baseURL);
  +                    }
  +                    catch (MalformedURLException ex) {
  +                        // ignore
  +                    }
  +                }
  +                entryCopy.setPublicId(matchingEntry.getPublicId());
  +                entryCopy.setLocation(matchingEntry.getLocation());
  +
  +                source = filesystemLookup(entryCopy);
   
                   if (source == null) {
  -                    source = classpathLookup(matchingEntry);
  +                    source = classpathLookup(entryCopy);
                   }
   
                   if (source != null) {
  @@ -1031,11 +1036,11 @@
               else {
                   //
                   // We didn't match a ResourceLocation, but since we
  -                // only support PUBLIC and URI entry types, it is
  -                // still possible that there is another entry in an
  -                // external catalog that will match.  We call Apache
  -                // resolver's resolveEntity method to cover this
  -                // possibility.
  +                // only support PUBLIC and URI entry types internally,
  +                // it is still possible that there is another entry in
  +                // an external catalog that will match.  We call
  +                // Apache resolver's resolveEntity method to cover
  +                // this possibility.
                   //
                   try {
                       result = 
  @@ -1095,4 +1100,5 @@
               externalCatalogsProcessed = true;
           }
       }
  -}
  +
  +} //-- XMLCatalog
  
  
  
  1.2       +3 -3      jakarta-ant/src/main/org/apache/tools/ant/types/resolver/ApacheCatalog.java
  
  Index: ApacheCatalog.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/resolver/ApacheCatalog.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ApacheCatalog.java	5 Nov 2002 16:33:29 -0000	1.1
  +++ ApacheCatalog.java	8 Nov 2002 09:53:22 -0000	1.2
  @@ -132,7 +132,7 @@
                   Debug.message(1, "Internal Error: null ApacheCatalogResolver");
               }
               else {
  -                resolver.addPublicEntry(publicid, systemid, base.toExternalForm());
  +                resolver.addPublicEntry(publicid, systemid, base);
               }
   
           } else if (type == URI) {
  @@ -144,7 +144,7 @@
                   Debug.message(1, "Internal Error: null ApacheCatalogResolver");
               }
               else {
  -                resolver.addURIEntry(uri, altURI, base.toExternalForm());
  +                resolver.addURIEntry(uri, altURI, base);
               }
   
           }
  
  
  
  1.2       +7 -7      jakarta-ant/src/main/org/apache/tools/ant/types/resolver/ApacheCatalogResolver.java
  
  Index: ApacheCatalogResolver.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/resolver/ApacheCatalogResolver.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ApacheCatalogResolver.java	5 Nov 2002 16:33:29 -0000	1.1
  +++ ApacheCatalogResolver.java	8 Nov 2002 09:53:22 -0000	1.2
  @@ -57,12 +57,12 @@
   import java.io.IOException;
   
   import java.net.MalformedURLException;
  +import java.net.URL;
   
   import org.apache.tools.ant.BuildException;
   
   import org.apache.tools.ant.types.XMLCatalog;
  -import org.apache.tools.ant.types.DTDLocation;
  -import org.apache.tools.ant.types.EntityLocation;
  +import org.apache.tools.ant.types.ResourceLocation;
   
   import org.apache.xml.resolver.Catalog;
   import org.apache.xml.resolver.CatalogManager;
  @@ -168,9 +168,9 @@
        */
       public void addPublicEntry(String publicid, 
                                  String systemid,
  -                               String base) {
  +                               URL base) {
   
  -        DTDLocation dtd = new DTDLocation();
  +        ResourceLocation dtd = new ResourceLocation();
           dtd.setBase(base);
           dtd.setPublicId(publicid);
           dtd.setLocation(systemid);
  @@ -194,9 +194,9 @@
        */
       public void addURIEntry(String uri, 
                               String altURI,
  -                            String base) {
  +                            URL base) {
   
  -        EntityLocation entity = new EntityLocation();
  +        ResourceLocation entity = new ResourceLocation();
           entity.setBase(base);
           entity.setPublicId(uri);
           entity.setLocation(altURI);
  
  
  
  1.5       +3 -3      jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/optional/XsltTest.java
  
  Index: XsltTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/optional/XsltTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- XsltTest.java	5 Nov 2002 16:20:03 -0000	1.4
  +++ XsltTest.java	8 Nov 2002 09:53:22 -0000	1.5
  @@ -98,12 +98,12 @@
       
       /**
        * A unit test for JUnit
  +     */
       public void testCatchNoDtd() throws Exception {
           expectBuildExceptionContaining("testCatchNoDtd",
  -                "expected failure",
  -                "Fatal error during transformation");
  +                                       "expected failure",
  +                                       "Fatal error during transformation");
       }
  -     */
   
       /**
        * A unit test for JUnit
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>