ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject AW: Remove duplicate JAR file names from an XML file
Date Tue, 27 Jul 2010 06:32:41 GMT
>I have an xml file which lists JAR file names in it with space 
>specified as a delimiter. There are duplications of JAR files 
>name in the file and I was wondering if there is a way to some 
>how get ride of the duplication, to get a file which has a 
>unique set of JAR file names?
>Example of file:
>antlr-2.7.6.jar antlr-2.7.6.jar antlr-2.7.6.jar 
>aopalliance-1.0.jar aopalliance-1.0.jar aopalliance-1.0.jar 
>commons-validator-1.0.2.jar commons-validator-1.0.2.jar 
>commons-lang-2.2.jar commons-lang-2.2.jar

I dont see any built-in possibility so you have to script/program your
own task.
- you could read the xml with <xmlproperty>
- adress the list as property
- split the property value and store it in a set
- change the set into a space delimited list and store it as property
- copy the xml file with replacing ${xml-property} by

Just my 5ct ;)


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

View raw message