Solved

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

Posted on 2010-09-01
7
824 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

785 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