开发者

Passing values from XML file to Ant

开发者 https://www.devze.com 2023-02-10 18:49 出处:网络
I\'ve a XML configuration file and I w开发者_Python百科ant my ANT script to fetch the values from the XML file and act based on those values. Is it possible? If so please describe...You can use the xm

I've a XML configuration file and I w开发者_Python百科ant my ANT script to fetch the values from the XML file and act based on those values. Is it possible? If so please describe...


You can use the xmlproperty property task. Lets say you have the xml file infoFile.xml

<?xml version="1.0" encoding="UTF-8"?>
<cat> 
<tabby> 
<name>Mittens</name>
<legs>4</legs> 
<colour>Ginger</colour>
</tabby>
</cat>

In your ANT script you can load it using 'xmlproperty'.

<xmlproperty file="infoFile.xml"/>

You can then access elements within that XML. ${cat.tabby.colour} More information can be found here. http://ant.apache.org/manual/Tasks/xmlproperty.html >

0

精彩评论

暂无评论...
验证码 换一张
取 消