Question

<?xml version="1.0" encoding="utf-8"?>
<Zones>
<database>User Id=myuser;Password=mypass;Data Source=xxxxxxx</database>
</Zones>

Is it possible to update the node value using xmlpoke and nant? My New Value

Was it helpful?

Solution

You can make the entire value a NAnt property

<property name="db.string" value="User Id=${myID};Password=${myPW};Data Source=${MyDataSource}" />

Then use the xmlpoke command, something like:

 <xmlpoke file="${YourFilePath}\MyConfig.config" xpath="//Zones/database" value="${db.string}" />

Once it locates that node, it will update the value you specified in the property. NOTE: Not tested.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top