Solved

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

Posted on 2010-09-01
7
837 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
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…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

728 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