You also could use <xmlproperty>:
<project>
<macrodef name="pomVersion">
<attribute name="name"/>
<attribute name="property" default="@{name}.version"/>
<attribute name="pom"/>
<sequential>
<xmlproperty file="@{pom}" prefix="_internal_.@{name}"/>
<property name="@{property}" value="${_internal_.@{name}.project.version}"/>
</sequential>
</macrodef>
<pomVersion name="hudson" pom="hudson-pom.xml"/>
<pomVersion name="args4j" pom="args4j-pom.xml"/>
<echo>
Args4J : ${args4j.version}
Hudson : ${hudson.version}
</echo>
</project>
Jan
>-----Ursprüngliche Nachricht-----
>Von: Brian Agnew [mailto:brian@oopsconsultancy.com]
>Gesendet: Freitag, 24. April 2009 14:30
>An: Ant Users List
>Betreff: Re: Reading and writing xml files
>
>If you're looking to extract values from the XML file rather than
>transform it, I'd take a look at XMLTask.
>
>http://www.oopsconsultancy.com/software/xmltask
>
>Brian
>
>jhoomsharabi@netscape.net wrote:
>> Hi All
>> I want to read lots of pom.xml file to pick <version> node,
>and than write the content to another xml file, can it be
>possible with ANT XSLT to do so?
>>
>> Thanks,
>> Jhoom
>>
>>
>
>--
>Brian Agnew http://www.oopsconsultancy.com
>OOPS Consultancy Ltd
>Tel: +44 (0)7720 397526
>Fax: +44 (0)20 8682 0012
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
|