ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeffrey E Care <>
Subject Re: Check that path elements exist?
Date Tue, 20 Apr 2010 01:51:32 GMT
Stefan Bodewig <> wrote on 04/15/2010 12:01:56 AM:

> On 2010-04-15, Jeffrey E Care <> wrote:
> > Before I write my own, if there a way to check that the elements of a 
> > actually exist (or optionally that at least one exists)?
> I assume you mean the <pathelement>'s of a <path>.  <resourcecount>,
> <restrict> and <exists> are the ingredients that should help.
> If you wrap your <path> in a <restrict> using <exists> as selector
> get only the existing elements.  <resourcecount> will count them and if
> it is greater than 0 you obviously have at least one - likewise if you
> count the path itself and compare the numbers you'll know whether all
> elements exist.

That worked perfectly, thanks.

And shame on me for posting this to dev instead of user...
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message