473,396 Members | 1,772 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to add parent node to existing xml file using c#?

I have a XML document having Student data, such as name, contact and program enrolled.
ex:
<Student>
<FirstName>Claire</FirstName>
<LastName>Damen</LastName>
<AddressLine>4A, Lane7</AddressLine>
<City>NH</City>
<State>Alaska</State>
<ProgramEnrolled>New Program</ProgramEnrolled>
<EnrollmentDate>2007-09-05</EnrollmentDate>
</Student>
I need to add parent nodes around the existing data, something like below.
<Student>
<Name>
<FirstName>Claire</FirstName>
<LastName>Damen</LastName>
</Name>
<Contact>
<AddressLine>4A, Lane7</AddressLine>
<City>NH</City>
<State>Alaska</State>
</Contact>
<Program>
<ProgramEnrolled>New Program</ProgramEnrolled>
<EnrollmentDate>2007-09-05</EnrollmentDate>
</Program>
</Student>

I have many sets of student data like this in the XML.
Thanks in advance.
Jul 11 '08 #1
0 1243

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: jon wayne | last post by:
OK! I had this nagging doubt Consider (without worrying abt access specifiers) class Kid : public Parent{...}; Parent::someFunc() { Kid k; }
2
by: David Lei | last post by:
Hi, How do I add a new parent node to the existing nodes? I have an existing XmlDocument object like this: <item> <something>ABC</something> <item> <item> <something>DEF</something>
1
by: clintonG | last post by:
How do I get a TreeNode.Parent property when using the 2.0 TreeView control? When the data source is an XML file there may be redundant names in the tree. For example, when a child node with the...
10
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the...
0
by: Dave Mathew | last post by:
I'm in the process of building some navigation for a website. I would like to use the capabilities of the sitemap in asp.net but have ran into some styling/usability issues in the past using just...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.