ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/types XMLCatalog.java
Date Tue, 10 Dec 2002 07:39:23 GMT
bodewig     2002/12/09 23:39:23

  Modified:    docs/manual/CoreTypes xmlcatalog.html
               src/etc/testcases/taskdefs/optional xmlvalidate.xml
               src/main/org/apache/tools/ant/types XMLCatalog.java
  Log:
  remove catalogfiles from xmlcatalog
  
  Revision  Changes    Path
  1.7       +2 -9      jakarta-ant/docs/manual/CoreTypes/xmlcatalog.html
  
  Index: xmlcatalog.html
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/docs/manual/CoreTypes/xmlcatalog.html,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- xmlcatalog.html	2 Dec 2002 16:06:09 -0000	1.6
  +++ xmlcatalog.html	10 Dec 2002 07:39:22 -0000	1.7
  @@ -84,8 +84,8 @@
   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>catalogpath</code> (or
  -the deprecated <code>catalogfiles</code>) , will be ignored and a warning
  +classpath, external catalog files, specified in <code>catalogpath</code>, 
  +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
  @@ -220,13 +220,6 @@
   XML format</a>. Entries specifying nonexistent files will be ignored. If the
   resolver library from xml-commons is not available in the classpath, all
   <code>catalogpaths</code> will be ignored and a warning will be logged.
  -</p>
  -<h4>catalogfiles (deprecated)</h4>
  -<p>
  -The nested <code>catalogfiles</code> element specifies a <a
  -href="../CoreTypes/fileset.html">FileSet</a>.  This is equivalent to
  -specifying a <code>&lt;fileset&gt;</code> inside a <code>catalogpath</code>,
  -and is retained for backwards-compatibility.
   </p>
   <h3>Examples</h3>
   <p>Set up an XMLCatalog with a single dtd referenced locally in a user's 
  
  
  
  1.11      +6 -2      jakarta-ant/src/etc/testcases/taskdefs/optional/xmlvalidate.xml
  
  Index: xmlvalidate.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/etc/testcases/taskdefs/optional/xmlvalidate.xml,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- xmlvalidate.xml	3 Dec 2002 14:40:50 -0000	1.10
  +++ xmlvalidate.xml	10 Dec 2002 07:39:22 -0000	1.11
  @@ -44,7 +44,9 @@
       <xmlvalidate warn="false">
         <fileset dir="xml" includes="**/about.xml"/>
         <xmlcatalog classpath="xml">
  -        <catalogfiles dir="xml" includes="catalog"/>
  +        <catalogpath>
  +          <fileset dir="xml" includes="catalog"/>
  +        </catalogpath>
           <dtd publicID="-//stevo//DTD doc 1.0//EN"
                location="doc.dtd"/>
         </xmlcatalog>
  @@ -68,7 +70,9 @@
       <xmlvalidate warn="false">
         <fileset dir="xml" includes="**/about.xml"/>
         <xmlcatalog classpath="xml">
  -        <catalogfiles dir="xml" includes="catalog"/>
  +        <catalogpath>
  +          <fileset dir="xml" includes="catalog"/>
  +        </catalogpath>
         </xmlcatalog>
       </xmlvalidate>
     </target>
  
  
  
  1.20      +7 -68     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.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- XMLCatalog.java	2 Dec 2002 16:30:50 -0000	1.19
  +++ XMLCatalog.java	10 Dec 2002 07:39:22 -0000	1.20
  @@ -104,13 +104,9 @@
    * 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 and
    * <code>&lt;catalogpath&gt;</code> paths, will be ignored and a warning
will
    * be logged.  In this case, however, processing of inline entries will proceed
    * normally.</p>
  - * <p>Note that, as <code>&lt;catalogpath&gt;</code> can contain
nested
  - * filesets, it is more general than <code>&lt;catalogfiles&gt;</code>,
which
  - * should be considered deprecated.</p>
    *
    * <p>Currently, only <code>&lt;dtd&gt;</code> and
    * <code>&lt;entity&gt;</code> elements may be specified inline; these
  @@ -168,7 +164,7 @@
   
       //-- Fields ----------------------------------------------------------------
   
  -    /** Holds dtd/entity objects and catalog filesets until needed. */
  +    /** Holds dtd/entity objects until needed. */
       private Vector elements = new Vector();
   
       /**
  @@ -196,11 +192,9 @@
       }
   
       /**
  -     * Returns the elements of the catalog - ResourceLocation and FileSet
  -     * objects.
  +     * Returns the elements of the catalog - ResourceLocation objects.
        *
  -     * @return the elements of the catalog - ResourceLocation and FileSet
  -     * objects
  +     * @return the elements of the catalog - ResourceLocation objects
        */
       private Vector getElements() {
           return elements;
  @@ -216,12 +210,12 @@
       }
   
       /**
  -     * Set the list of ResourceLocation objects and FileSets in the catalog.
  +     * Set the list of ResourceLocation objects in the catalog.
        * 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 aVector the new list of ResourceLocations and FileSets
  +     * @param aVector the new list of ResourceLocations
        * to use in the catalog.
        */
       private void setElements(Vector aVector) {
  @@ -280,30 +274,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.
  -     *
  -     * @param fs the fileset of external catalogs.
  -     * @exception BuildException
  -     * if this is a reference and no nested elements are allowed.
  -     */
  -    public void addCatalogfiles(FileSet fs) throws BuildException {
  -        if (isReference()) {
  -            throw noChildrenAllowed();
  -        }
  -        getElements().addElement(fs);
  -    }
  -
  -
       /** Creates a nested <code>&lt;catalogpath&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
        * if this is a reference and no nested elements are allowed.
        */
  @@ -559,19 +534,6 @@
                   // available, so we can't use it.
                   //
                   catalogResolver = new InternalResolver();
  -                //
  -                // If any <catalogfiles> are specified, warn that they
  -                // will be ignored.
  -                //
  -                Enumeration enum = getElements().elements();
  -                while (enum.hasMoreElements()) {
  -                    Object o = enum.nextElement();
  -                    if (o instanceof FileSet) {
  -                        log("Warning: External catalogfiles will be ignored",
  -                            Project.MSG_WARN);
  -                        break;
  -                    }
  -                }
                   if (getCatalogPath() != null &&
                       getCatalogPath().list().length != 0) {
                           log("Warning: catalogpath listing external catalogs"+
  @@ -1125,7 +1087,7 @@
   
           /**
            * Process each external catalog file specified in a
  -         * <code>&lt;catalogfiles&gt;</code> FileSet.  It will be
  +         * <code>&lt;catalogpath&gt;</code>.  It will be
            * parsed by the resolver library, and the individual elements
            * will be added back to us (that is, the controlling
            * XMLCatalog instance) via a callback mechanism.
  @@ -1141,29 +1103,6 @@
                   }
                   catch (Exception ex) {
                       throw new BuildException(ex);
  -                }
  -
  -                // Parse each catalog listed in nested <catalogfile> elements.
  -                Enumeration enum = getElements().elements();
  -                while (enum.hasMoreElements()) {
  -                    Object o = enum.nextElement();
  -                    if (o instanceof FileSet) {
  -                        FileSet fs = (FileSet)o;
  -                        DirectoryScanner ds = 
  -                            fs.getDirectoryScanner(getProject());
  -                        String[] files = ds.getIncludedFiles();
  -                        for (int i = 0; i < files.length; i++) {
  -                            File catFile = new File(ds.getBasedir(), files[i]); 
  -                            try {
  -                                parseCatalog.invoke(resolverImpl, 
  -                                                    new Object[] 
  -                                { catFile.getPath() });
  -                            }
  -                            catch (Exception ex) {
  -                                throw new BuildException(ex);
  -                            }
  -                        }
  -                    }
                   }
   
                   // Parse each catalog listed in nested <catalogpath> elements
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message