开发者

Passing values from XML file to Ant

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜