Click here to Skip to main content
15,902,635 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I have some properties for the class which is doing the serializing process.
I have written a property for the class which the type is custom.
after serialization the output is like below:

XML
<?xml version="1.0" encoding="UTF-8"?>
-<Persons xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> -<Students> <Name>BehnouD</Name> <Family>Sherafati</Family> -<Account> <Number>10000</Number> </Account> </Students>



I want to have the format of Account property like other properties.
what can I do?
Tnx
Posted

1 solution

Go thru each examples here - http://www.switchonthecode.com/tutorials/csharp-tutorial-xml-serialization[^] and try to understand the XmlAttribute and XmlElement. Hope it solve your issue.
 
Share this answer
 
Comments
Behno0o0oD 15-Oct-12 4:16am    
Thanks, It was very helpful, but I didn't get my answer, I want to get rid of the -<<Account>> and <<Account>> and I want to add Number like the other properties.
What Can I Do??

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