Click here to Skip to main content
14,970,219 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I can do this XML with xmlserialization?
  <id value="1234567890" />
    <Title value="Starship Troopers" />
    <rating value="6" />
    <releasedate value="2011-09-20" />

kennytan_ph 5-Oct-11 8:49am
sorry, it's not clear enough to me what you want to do.
Member 3854684 5-Oct-11 9:10am
I wanto to write a c# class for serialize data like xml example

You have tagged this question with XmlReader, which is probably what you want to use to read your XML.

XML serialization is a way of persisting objects and retrieving them later. It is not for reading arbitrary XML files.
Good point, my 5. And I don't see no much value in custom serialization when Data Contract is available. Well, maybe something like encryption of data, compression of big volumes of data or something exotic.
you can try this classes...

public class xmlClass
public IDElement ID;
public datiElement dati;

public class IDElement
public long value;

public class datiElement
public TitleElement Title;
public ratingElement rating;
public releaseDateElement;

public class TitleElement
public string value;

public class ratingElement
public int value;

public class releaseDateElement
public Date Value;

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