Link to home
Start Free TrialLog in
Avatar of meetpd
meetpdFlag for India

asked on

Problem creating Subnode while creating XML file through XML Serialization using C#

I am creating an XML file using XML Serialization by converting XML schema to class file.

In this class file, I have following elements:

Class is 'PersonalInfo'
Class inside 'PersonalInfo' is 'AssesseeName'
Attributes of 'AssesseeName' are 'First Name', 'Last Name'.

I want to know the approach about how to have the above node structure when we create XML file through XML Serialization.

Thanks!
Avatar of Anurag Thakur
Anurag Thakur
Flag of India image

The way you have explained your structure of classes and properties in it following xml structure will be generated on serialization

PersonalInfo
      AssesseeName
            FirstName
            LastName
Avatar of meetpd

ASKER

Yes what you have understood is correct. What I am not able to understand is how do I achieve that through C#. Can you please suggest?
ASKER CERTIFIED SOLUTION
Avatar of Anurag Thakur
Anurag Thakur
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial