Page 1 of 1

Edit XML File NOT Using Key\Value!

Posted: Thu Dec 15, 2011 2:01 pm
by pointeman
Our XML file does not have Key\Value like other postings I've found here on IA forums. Thus I post...

Code: Select all

Our XML Config.xml:
<?xml version="1.0"?>
<Settings>
  <SqlConn>@SQLCONN@</SqlConn>  
</Settings>
We formerly used the EditFile plugin like this:

Code: Select all

Set Variable EDITFILERESULT to 
EditFile $TARGETDIR$\Project1\config.xml, Replace "@SQLCONN@" with "$SQLCONN$" (Result in EDITFILERESULT)
1. Now we're using 'Edit XML File' although we're not sure if our coding is correct?
2. How do we handle the (Result in EDITFILERESULT) as before?

Re: Edit XML File NOT Using Key\Value!

Posted: Fri Dec 16, 2011 8:35 am
by BobSchaefer
My best guess, as I'm not running the newer versions of IA, but have extensive XML experience would be:

Change the value in Element Path to be: Settings\SqlConn
Add the $SQLCONN$ variable as the Element Text: value

That should get you the result you want, and you can remove the @SQLCONN@ value from the XML file.

Re: Edit XML File NOT Using Key\Value!

Posted: Mon Dec 26, 2011 4:09 pm
by pointeman
Excellent! It finally works after following your advice BobSchaefer:

" Change the value in Element Path to be: Settings\SqlConn "
" Add the $SQLCONN$ variable as the Element Text: value "

Thank You :D