Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: changing the xml file

From: "Joe Fawcett" <joefawcett@---------.------>
To: 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




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent