Page 1 of 1

XML Edits

Posted: Tue Jul 03, 2012 11:13 am
by mfishman
In this example:
<appSettings>
<add key="ConnectionShort" value="SERVER=LLDEV01;UID=sa;PWD=access;DataBase="/>
<add key="CompanyConnStr" value="SERVER=LLDEV01;UID=sa;PWD=access;Database=MIF45_NAS"/>
<add key="ImportPath" value="C:\SOILPOST.TXT"/>
<add key="ExportPath" value="D:\SOIL.txt"/>
<add key="ROOTPATH" value="G:\\FulcrumSourceCode\\Applications\\Fulcrum45\\"/>
<add key="FromEmail" value="[email protected]"/>
<add key="ToEmail" value="[email protected]"/>
<add key="SMTPServer" value="mail.lanactech.com"/>
<add key="ReportExportPath" value="http:\\localhost\\"/>
<add key="DataDynamicsARLic" value="NAS Team,Lanac Techology,DD-ARN-20-E003963,29KPT2H2TKHCPHTM1622"/>
<add key="ServerName" value="FulcrumSQLCrystalDSN"/>
<add key="Username" value="sa"/>
<add key="Password" value="access"/>
<add key="UserSeats" value="10"/>
<add key="CrystalImageCleaner-AutoStart" value="true"/>
<add key="CrystalImageCleaner-Sleep" value="60000"/>
<add key="CrystalImageCleaner-Age" value="120000"/>
<add key="ChartHttpHandler" value="Storage=memory;Timeout=180;Url=~/temp/;"/>
<add key="SQLTimeout" value="300"/>
<add key="CompanyDB" value="MIF45_NAS"/>
<add key="NatlActDB" value="MIF45_COR"/>
<add key="ProductName" value="NAS"/>
</appSettings>

How would I replace "MIF45_NAS" with a value in the variable $dbNameAdmin$ for the key "CompanyDB"

I've tried the XML Edit plug-in but I can't seem to make this happen. And yes, I've searched this board.

Re: XML Edits

Posted: Tue Jul 03, 2012 11:53 am
by FrancescoT
Dear Mfishman,

Actually there are some limitations with XML Edit, but what you are trying to do seems to be possible.

Have you tried if using the following commands in sequence could you solve your issue?

> Read from Text File
> Replace String
> Write to Text File

Regards

Re: XML Edits

Posted: Tue Jul 03, 2012 11:58 am
by mfishman
When you say, "Actually there are some limitations with XML Edit" do you mean that I can't replace the value of an XML value pair?

No, I haven't tried anything else because I thought that was what XML Edit was for, to edit an XML file. Can you provide a code snippet of what you are talking about?

Re: XML Edits

Posted: Tue Jul 03, 2012 3:24 pm
by mfishman
Apologies.

See http://www.installaware.com/forum/viewt ... f=2&t=6797

If you delete the key and then re-add it, it looks like it does the job.