If i have a class MovieClass as
[XmlRoot("MovieClass")]
public class Movie
{
[XmlElement("Novie")]
public string Title;
[XmlElement("Rating")]
public int rating;
}
How can I have an attribute "x:uid" in my "Movie" element, so that the output when XmlSerializer XmlSerializer s = new XmlSerializer(typeof(MovieClass)) was used is like this:
<?xml version="1.0" encoding="utf-16"?>
<MovieClass>
<Movie x:uid="123">Armagedon</Movie>
</MovieClass>
and not like this
<?xml version="1.0" encoding="utf-16"?>
<MovieClass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Movie x:uid="123" Title="Armagedon"/>
</MovieClass>
Note: I want the xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" removed, if possible.