ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "J.Pietschmann" <j3322...@yahoo.de>
Subject Re: How to set the XSLT task XML parser to non-validating
Date Tue, 23 Sep 2003 18:07:36 GMT
Matt MacDonald wrote:
> Notice the URI: 'jar://resources/psdp.dtd'
> 
> When I try to use the ant:xslt task to apply a stylesheet to this XML 
> document I get the following error:
> 
> Fatal Error! java.net.MalformedURLException: no !/ in spec Cause: 
> java.net.MalformedURLException: no !/ in spec
> 
> I know the URI in the doctype is not a valid Java URL so how do I set 
> the XML parser in Ant to be non-validating?

The XML parser used by the XSLT task is by default non-validating.
However, even non-validating parsers may read the DTD, for resolving
entities. There is no standardized option to control this behaviour.
Note that the URL
  jar://resources/psdp.dtd
is not a valid URL for the Java run time library, which is commonly
used for resolving the URL. A valid Jar URL would be
  jar:file:///foo/bar.jar!/ressources/psdp.dtd
Your best bet is to remove the DOCTYE decl before processing
completely, unless you actually use entities defined in the DTD. In
this case, you'll probably have to edit the URL to a valid URL,
or use the catalog. Actually, some XML parsers use the catalog for
resolving SYSTEM ids as well, however, they may require the URL to
be valid (for the RTL) anyway.

J.Pietschmann



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message