XML Edits

Got a problem you cannot solve? Try here.
Post Reply
mfishman
Posts: 11
Joined: Fri May 04, 2012 11:56 am

XML Edits

Post 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.
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: XML Edits

Post 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
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
mfishman
Posts: 11
Joined: Fri May 04, 2012 11:56 am

Re: XML Edits

Post 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?
mfishman
Posts: 11
Joined: Fri May 04, 2012 11:56 am

Re: XML Edits

Post 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.
Post Reply