ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craeg K Strong <>
Subject Re: XMLCatalog: use Paths instead of FileSets?
Date Mon, 02 Dec 2002 03:32:01 GMT

I just got back from a week out of the country,
and off-line.

I am happy with this change.  By all means, let's do
it now while there are no backward compatibility issues :)
In other words, no real need to deprecate anything.

You may want to keep the old interface just for convenience,
the same way other ant tasks create implicit enclosing
elements when there is only one...



Jeff Turner wrote:
> Hi,
> The XMLCatalog type has recently had support added for external catalog
> files, through the addition of nested <catalogfiles> FileSets:
> <xmlvalidate ...>
>   <xmlcatalog>
>     <catalogfiles dir="...">
>       <include name="catalog*" />
>     </catalogfiles>
>   </xmlcatalog>
>   ...
> </xmlvalidate>
> This is fine, but doesn't allow one to list catalogs that _may_ exist.
> For example, in Forrest we have a central catalog under $FORREST_HOME,
> and then the user may optionally specify their own catalog, listing
> project-specific DTDs.  There is no way currently to represent that
> optional catalog, because the FileSet throws a BuildException if it
> isn't present.
> Likewise, many (but not all) Unix systems have a central catalog in
> /etc/sgml/catalog.  It would be nice to be able to add this to a
> 'catalog search path', without risking failure if it isn't present.
> Also, many SGML/XML tools (nsgmls, jade, xsltproc, xmllint) use a
> SGML_CATALOG_FILES env variable to locate catalogs.  This variable
> contains a colon-separated list of catalogs.  I'd like to be able to
> use this in Ant.
> All this can be achieved if catalogs are specified in path, rather
> than a fileset.  There is a strong analogy here with classpaths: just
> as a class may be in any jar in a classpath, so a DTD ref may be in
> any catalog listed in a catalogpath.
> So I propose the introduction of a <catalogpath> nested element.  As a
> Path can contain FileSets, <catalogpath> would subsume the
> functionality of <catalogfiles>, which would be deprecated.
> <catalogpath> would allow stuff like:
> <pathelement location="/etc/sgml/catalog"/>
> and
> <pathelement path="${env.SGML_CATALOG_FILES}"/>
> and for Forrest:
> <xmlvalidate...>
>   <xmlcatalog>
>     <catalogpath>
>       <pathelement location="${project.schema-dir}/catalog"/>
>       <fileset dir="${forrest.home}/context/resources/schema">
>         <include name="catalog" />
>       </fileset>
>     </catalogpath>
>   </xmlcatalog>
> ...
> I have this change working locally, but thought I'd bounce the idea on
> the list before tidying it up, doing docs, unit tests etc.
> I see Jose Alberto is also playing with <xmlcatalog>.  I don't _think_
> this intersects, but Cc'ing to make sure..
> Any opinions?
> --Jeff

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message