Solved

How to change the XML file Root and XmlDeclaration using C#

Posted on 2010-09-01
7
818 Views
Last Modified: 2012-05-10
HI Expert ;

I have the following XML File and I want to process somme modifications as Changing the The  Node name <NewDataSet> to <ActualKPITest> and XMLDeclartion  <?xml version="1.0" standalone="yes" ?>  to  <?xml version="1.0" encoding="utf-8" standalone="yes" ?>

My file is :
  <?xml version="1.0" standalone="yes" ?>
- <NewDataSet>
- <SSISPackageLayout>
  <SettingKey>SSISOpsFrameworkVersion</SettingKey>
  <SettingValue>5</SettingValue>
  <DateCreated>2010-08-05T16:10:27.567-04:00</DateCreated>
  <DateModified>2010-08-05T16:10:27.887-04:00</DateModified>
  <LastUserChanged>Papa\Tata</LastUserChanged>
  <Description>This represents the version number of auditing framework. This number is updated when auditing framework changes are applied.</Description>
  </SSISPackageLayout>
  </NewDataSet>

How to do that with C#
0
Comment
Question by:Fatehbourghoud
  • 3
  • 3
7 Comments
 
LVL 8

Expert Comment

by:Gururaj Badam
ID: 33580503
You can import the xml into DataSet.ReadXml first, then modify the Table name NewDataSet to ActualKPITest and write back to whatever for you need using DataSet.WriteXml overloads
0
 

Author Comment

by:Fatehbourghoud
ID: 33580688
The Child Node i <SSISPackageLayout> is my table name I don't want to change it , the probleme is the Dataset.WriteXML  overload create the default Node  <NewDataSet> . and I wnat to replace it

02- what about the changing  XMLDeclartion  <?xml version="1.0" standalone="yes" ?>  to  <?xml version="1.0" encoding="utf-8" standalone="yes" ?>  , any solution ?

Thank's
0
 
LVL 6

Expert Comment

by:nipunu
ID: 33584137
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 8

Expert Comment

by:Gururaj Badam
ID: 33584210
0
 

Author Comment

by:Fatehbourghoud
ID: 33586497
I fixed the bug
0
 
LVL 8

Accepted Solution

by:
Gururaj Badam earned 500 total points
ID: 33586526
wow!! that's good. How?
0
 

Author Closing Comment

by:Fatehbourghoud
ID: 33675798
lalala
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
How to get a file from SqlServer DB 4 29
C# remove trailing commas from csv file 10 52
Pass through dll 2 38
Image(2) 3 28
Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now