ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From WULMS Alex <>
Subject Ant xslt task seems to ignore xmlcatalog for mapping dtds
Date Thu, 25 Apr 2013 13:05:08 GMT

I'm trying to use the xslt task in Ant to validate some xhtml files. The xhtml files start
with a <!DOCTYPE ...> line to indicate the xhtml version. The doctype refers a DTD,
like in following example:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html  xmlns:h="">

The xslt task tries to connect to to fetch the dtd. But I'm behind a firewall so
that fails. When I run ant with -v, I get amongst others following message in the stack trace:
... some stuff about HttpClient and HttpURLConnection

I have read about the xmlcatalog element that can be used to map the dtd-id to a local file.
I have tried to set it up as follows:

  <xmlcatalog id="xhtmlDTDs">
	  <dtd publicId="-//W3C//DTD XHTML 1.0 Transitional//EN" location="${product.home}/dtd/xhtml1-transitional.dtd"/>
  <target name="validate-xhtml">
  	<mkdir dir="${module.home}/validate-xhtml-rslt}"/>
  		<xmlcatalog refid="xhtmlDTDs" />
  		<mapper type="glob" from="*.xhtml" to="*.html"/>

But despite the xmlcatalog being defined, I still get the very same exception.

Note that I'm using ant 1.7.1 which is bundled with eclipse and I'm running it with a JRE I have also added resolver.jar from apache xml-commons to the classpath but it does
not help neither.

Note that this is the output from ant with -v option:
    [mkdir] Skipping P:\srcSDC\idm\modules\identitypublicweb\validate-xhtml-rslt} because
it already exists.
     [xslt] Using class
     [xslt] Transforming into P:\srcSDC\idm\modules\identitypublicweb\validate-xhtml-rslt
     [xslt] Processing P:\srcSDC\idm\modules\identitypublicweb\src\webroot\alex.xhtml to P:\srcSDC\idm\modules\identitypublicweb\validate-xhtml-rslt\alex.html
     [xslt] Loading stylesheet P:\srcSDC\idm\modules\identitypublicweb\validate-xhtml.xslt
Apache resolver library found, xml-commons resolver will be used
     [xslt] : Error!
     [xslt] : Error!
     [xslt] Failed to process null

After that comes the stacktrace with the host not found exception

Any help or hints in fixing this are appreciated.

Thanks and kind regards,

Alex Wulms
SWIFT | Lead Developer / E-channel 
Tel: +32 2 6553931

This e-mail and any attachments thereto may contain information which is confidential and/or
proprietary and intended for the sole use of the recipient(s) named above. If you have received
this e-mail in error, please immediately notify the sender and delete the mail.  Thank you
for your co-operation.  SWIFT reserves the right to retain e-mail messages on its systems
and, under circumstances permitted by applicable law, to monitor and intercept e-mail messages
to and from its systems.

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

View raw message