Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - changing the xml file [Thread Next] Re: changing the xml fileTo: NULL Date: 12/4/2007 1:44:00 PM "Vinki" <Vinki@d...> wrote in message
news:EBB82B26-7AC6-4E3D-9C18-ACA919DEAF20@m......
>I have this xml file below, I want to change the value of debug to false.
> How can I do this in C# or VB.net. if possible in this case I want use
> SelectSingleNode
>
>
>
>
> <?xml version="1.0"?>
> <configuration>
> <configSections>
> <section name="dataConfiguration"
> type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings,
> Microsoft.Practices.EnterpriseLibrary.Data" />
> </configSections>
> <connectionStrings>
>
> </connectionStrings>
> <appSettings>
> <add key="connectionString" value="sita" />
>
> </appSettings>
> <compilation debug="true">
>
> </compilation>
> <!--<runtime>
> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
> <dependentAssembly>
> <assemblyIdentity name="System.Data.OracleClient"
> publicKeyToken="B77A5C561934E66" culture="neutral"/>
> <bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0"/>
> </dependentAssembly>
> </assemblyBinding>
> </runtime>-->
> </configuration>
>
> Any help will be appreacitaed
>
>
> Thanks.
One way is to load it into an XmlDocument, there are a few ways depending if
it's accessed via a URL or as a string of XML etc.
Then find the element you need:
XmlElement compilation = xmlDoc.SelectSingleNode("/*/compilation") as
XmlElement;
compilation.SetAttribute("debug", "false");
--
Joe Fawcett (MVP - XML)
http://joe.fawcett.name
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
