xml-commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craeg K Strong <cstr...@arielpartners.com>
Subject Re: Question/enhancement request for Norman Walsh's resolver 1.1 library
Date Fri, 10 May 2002 22:35:31 GMT

After carefully studying both the Ant <xmlcatalog> datatype and
the xml-commons resolver library, I have designed and implemented
an integration that I believe will fit the bill.  I submitted
my code to ant-dev last night, and hopefully it will make it
into the core.

Here is what I did:

The original <xmlcatalog> datatype provides the ability to specify
elements that roughly correspond to PUBLIC and URI catalog entries.
It was implemented without any external code dependencies, specifically
there are no calls to the xml-commons resolver.

I have come to realize that, for the vast majority of Ant users,
that will be enough.  On the other hand, a few people (like me :-)
need the full capabilities of OASIS catalogs.

So I created my own subclasses of ResolverCatalog and Catalog and
I made XMLCatalog.java call out to ResolverCatalog using reflection.

If the classloader _can_ instantiate the object, I know resolver.jar is
in the classpath.

If the classloader _can not_ instantiate the object, I know resolver.jar
is NOT in the classpath.

If resolver.jar is available, <xmlcatalog> will process <catalogfiles> entries
that identify external OASIS catalog files.  If it is not, any <catalogfiles>
entries will be ignored (a build warning will be logged).

I have attached the java sourcecode that makes up the bulk of the integration
for your delectation.  It is thoroughly commented and fairly well factored, so 
shouldn't be difficult to read through...(famous last words...:-)
Comments welcomed.



PS I noticed that the word "element" and "entry" are used interchangeably in the
OASIS XML Catalog standard.  Is this intentional?  Perhaps choosing one or the
other would be better...

View raw message