Solved

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

Posted on 2010-09-01
7
831 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
 
LVL 6

Expert Comment

by:nipunu
ID: 33584137
0
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!

 
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
IEnumerable<T> to a List<T> 8 65
C# Windows app updating JSON file error. 9 48
c# ftp code 3 53
Easiest intro into .NET CORE? 2 30
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…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

738 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