Reputation: 1
I have an xml like below.
<?xml version="1.0" encoding="UTF-8"?>
<Root>
<environment env="dev">
<BASE_URI>dev BASE_URI</BASE_URI>
<PROXY_HOST>dev PROXY_HOST</PROXY_HOST>
<PROXY_PORT>dev PROXY_PORT</PROXY_PORT>
</environment>
<environment env="dev2">
<BASE_URI>test3 BASE_URI</BASE_URI>
<PROXY_HOST>test3 PROXY_HOST</PROXY_HOST>
<PROXY_PORT>test3 PROXY_PORT</PROXY_PORT>
</environment>
</Root>
From ant, i will take the env as the input and i need to read all the properties of it and write to a file.
Upvotes: 0
Views: 687
Reputation: 530
I'm not clear what you want. Do you need generate this xml based on env. variables? If so:
Upvotes: 0
Reputation: 107040
Not 100% sure what you want. However, take a look at the <xmlproperty>
task. This reads an XML file and turns it into a list of Ant properties (usually .
formatted). Then, you can use the <echoproperties>
task to print out those properties into a Java formatted properties file.
Is this what you're looking for?
If I had a bit clearer description, I could give you a coding example.
Upvotes: 1