Xml Attibute in C#
XML / XSL
1
Posts
1
Posters
0
Views
1
Watching
-
HI am trying to Serialize( cos requested by application ) a class using XML Attributes. Xml file should be like the one written below. I tried using XML Serialization Attributes but I cannot find any solution. The fact is that for each item name is an attribute for the class variable, but I am not able to put the value without adding an extra tag. Have you some idea about that? OUPUT on FILE expected <MyData> <variable name="FirstVar">value <variable name="FirstVar">value1</variable> <variable name="SecondVar">value2</variable> <variable name="ThirdVar">value3</variable> </MyData> MY CLASS that doesn't work class variable { [XmlAttribute] String name; } class MyData { [XmlElement] variable[] list; }