You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Willie Wheeler <ww...@andrew.cmu.edu> on 2004/04/26 19:24:13 UTC

Style task does not fail fast

Hi all,

	I hope this is the right list to which to post.  :-)
	The style task under Ant 1.6.1 does not fail fast, in at least
certain error conditions.  For example, I just spent about half an hour
debugging a stylesheet.  It turned out that I'd written

	<xsl:apply-tempaltes/>

instead of

	<xsl:apply-templates/>

	Ant does in fact catch the error (it reports

[style] C:/cygwin/home/wwheeler/oli/logic-1.0/omdoc/omdoc2oli.xsl:116:29:
Er ror! xsl:apply-tempaltes is not allowed in this position in the
stylesheet!

as it's doing the build), but then the build just continues.  And when the
message is buried among hundreds of lines of other messages, it is easy
for it to go by unnoticed.  It seems to me that an error like that ought
to stop the build.  I think in earlier versions of Ant it stopped the
build.

	Willie

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


Re: Style task does not fail fast

Posted by Stefan Bodewig <bo...@apache.org>.
On Mon, 26 Apr 2004, Willie Wheeler <ww...@andrew.cmu.edu> wrote:

> 	Ant does in fact catch the error (it reports
> 
> [style]
> C:/cygwin/home/wwheeler/oli/logic-1.0/omdoc/omdoc2oli.xsl:116:29: Er
> ror! xsl:apply-tempaltes is not allowed in this position in the
> stylesheet!
> 
> as it's doing the build), but then the build just continues.  And
> when the message is buried among hundreds of lines of other
> messages, it is easy for it to go by unnoticed.  It seems to me that
> an error like that ought to stop the build.  I think in earlier
> versions of Ant it stopped the build.

Maybe these earlier versions of Ant also used a different version of
Xalan?

For Ant it is very difficult (I tend to say impossible) to guess from
the text of an error message - and that's all Ant has here - that the
problem is fatal.  In fact, TraX defines
javax.xml.transform.ErrorListener which is implemented by Ant and this
has error(TransformerException) as well as
fatalError(TransformerException).  If the transformer issues a
fatalError call, Ant terminates the process, but in your case the
transformer decided it was non fatal and only called error.

Like I said, it may have been a different version of the transformer.

Stefan

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