xsl-list
[Top] [All Lists]

Re: [xsl] Removing dead targets from Ant build files

2008-01-02 14:15:15
Heath, Graham wrote:
<xsl:if test="//target[contains(@depends,$name)]

Note that this will also find a target named "compile"
in a dependency list containing "compile-stuff". IIRC
ant target dependency lists contain comma separated,
optionally whitespace surrounded values. Therefore
a more exact approach is to kill whitespace in the
dependency list and surround everything by guarding
commas, somewhat like:
 test="//target[contains(
  concat(',',translate(@depends,' &#xA',''),','),
  concat(',',$name,',')]

You may run into performance problems for large
ant files, but reformulating this search using keys
should solve these.

It is quite possible that ant target names are also
whitespace trimmed by ant, which would mean you have
to do the same in the XSLT also. Please refer to the
ant docs for further details.

J.Pietschmann

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>