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 >
精彩评论