I've already written it if you want a copy.  Here's
the header of what it does:

//
//  This program will open an xml master settings file
that contains information to
//  set settings in all of the config files that are
environmentally dependant.
//  The master file contains:
//  1)  Where to get the config files to change
//  2)  Where to save the changed version down to
(staging area)
//  3)  What settings need to be changed
//  4)  The value those settings will be set to for
each environment
//
//  This program will loop through the settings for
each of these files, make
//  the necessary changes for the environmental
settings (environment is passed
//  in as an argument), and save the config files down
in the desired location.
//
//  *Example master config section:
//
//  <?xml version="1.0" encoding="utf-8" ?>
//  <configFile
name="D:\projects\MyProject\Web\Web.config" 
//      
newLocation="D:\projects\MyProject\Deploy\Tier1\Web.config">
//
//    <setting 
//     
xpath="/configuration/appSettings/[EMAIL PROTECTED]'ConnectionString']/@value"
//     
qa="server=myQAServer;database=myQADatabase;Connection
Reset=false;Trusted_Connection=True;"
//     
stage="server=myStagingServer;database=myStagingDatabase;Connection
Reset=false;Trusted_Connection=True;"
//     
prod="myProductionServer;database=myProductionDatabase;Connection
Reset=false;Trusted_Connection=True;"
//
//    <setting 
//     
xpath="/configuration/appSettings/[EMAIL PROTECTED]'ErrorLogPath']/@value"
//      qa="C:\Program Files\MyApplication\ErrorLogs"
//      stage="C:\Program
Files\MyApplication\ErrorLogs"
//      prod="W:\Program
Files\MyApplication\ErrorLogs"
//
//  </configFile>
//
//
//  There must be one configFile section for each
config file in the application.
//
//  This program is called at the command line with
the entry:
//      >CreateConfig env
//  *where env = environment (qa, stage, prod)
//  
//



--- Martin Gainty <[EMAIL PROTECTED]> wrote:
> Much easier to write with CSharp using XML
> Serialization and DeSerialization
> take a look at
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
> frlrfSystemXmlSerialization.asp
> -martin
> ----- Original Message -----
> From: "Hamza Zeen-Aldin" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, July 08, 2004 9:43 AM
> Subject: [Nant-users] Reading XML file and replacing
> text
> 
> 
> > I have and XML Config file for a C# application.
> There is a URL element
> > for SOAP remoting, there are multiple servers used
> for back up. How can
> > I replace all of the old URLs with a new URL
> that's in stored in another
> > XML file that has all of the server information.
> >
> > I tried using XMLPoke and XMLPeek, they work for
> specific elements but
> > how can I do it for all the instances of the URL
> string which belong to
> > different elements.
> >
> > Thanks,
> > Z
> >
> >
> >
>
-------------------------------------------------------
> > This SF.Net email sponsored by Black Hat Briefings
> & Training.
> > Attend Black Hat Briefings & Training, Las Vegas
> July 24-29 -
> > digital self defense, top technical experts, no
> vendor pitches,
> > unmatched networking opportunities. Visit
> www.blackhat.com
> > _______________________________________________
> > Nant-users mailing list
> > [EMAIL PROTECTED]
> >
>
https://lists.sourceforge.net/lists/listinfo/nant-users
> >
> 
> 
>
-------------------------------------------------------
> This SF.Net email sponsored by Black Hat Briefings &
> Training.
> Attend Black Hat Briefings & Training, Las Vegas
> July 24-29 - 
> digital self defense, top technical experts, no
> vendor pitches, 
> unmatched networking opportunities. Visit
> www.blackhat.com
> _______________________________________________
> Nant-users mailing list
> [EMAIL PROTECTED]
>
https://lists.sourceforge.net/lists/listinfo/nant-users
> 



        
                
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to