ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kronus David" <>
Subject RE: <xmlcatalog> query
Date Tue, 04 Aug 2009 12:05:11 GMT
Hi Brian,
if a DTD does not have a public ID (you have to look at the DTD itself, there may be one eventhough
it is not used in the XML), it has just the system one and then this is immediately the location
of the file, how else would you refer to it? Another thing is a mapping of an URL (which is
the system ID in your XML) to a local copy of the referenced DTD, i.e. to a local URL or filepath.
This is probably what you want to do. But I don't think it is possible to do this directly
in an antfile using XMLCatalog element itself. You will probably have to use Apache XML-commons
resolver with an external catalog file such as OASIS XML Catalog. Then in your antfile you
will use something like:

    <pathelement location="xmlcatalog.xml"/>

And in the referenced external file xmlcatalog.xml you will have something like:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE catalog
    PUBLIC "-//OASIS//DTD XML Catalogs V1.1//EN" 

Which will then map all requests for the given http:// URL to a local file w3c-xmlschema-1.0.dtd.
Hope that helps.

-----Original Message-----
From: Brian Agnew [] 
Sent: Tuesday, August 04, 2009 1:23 PM
To: Ant Users List
Subject: <xmlcatalog> query
Hi -
When using <xmlcatalog> I have to specify the DTD public id, and the 
location. Now, if I have an XML with the following DOCTYPE definition
This appears to have no public id (or is it implicit, somehow?). How do 
I reference a local copy of the above DTD using <xmlcatalog> ?
Brian Agnew
OOPS Consultancy Ltd
Tel: +44 (0)7720 397526
Fax: +44 (0)20 8682 0012
To unsubscribe, e-mail:
For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message