Click here to Skip to main content
15,893,814 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi ,

I have property class for genrate xml like

My C# Class :
[XmlRoot("root")]
public class root
{
[XmlElement("Con")]
public string Con { get; set; }
}

I have code for creating xml but i want add multiple element in single root so how can i write in c# property class for directly put value using code

For Ex. I need this type of xml



[root]
[con]1 [/con]
[con]2 [/con]
[con]3 [/con]
[/root]

Note : "[" == "<" and "]" == ">" for "[" it is use for show in question only so you can understand
Posted
Updated 18-Feb-15 19:45pm
v2
Comments
Sergey Alexandrovich Kryukov 19-Feb-15 2:30am    
Why doing all that? It's a pretty bad way of dealing with XML. What are you trying to achieve, exactly?
—SA

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900