Solved

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

Posted on 2010-09-01
7
827 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

820 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