The DataContract
serializer does not allow this degree of control over the resulted XML, you will have to use instead the XmlSerializer
in order to achieve this.
More Related Contents:
- XML Serialization and namespace prefixes
- Why doesn’t the XmlSerializer need the type to be marked [Serializable]?
- Cloning objects without Serialization
- Using DataContractSerializer to serialize, but can’t deserialize back
- Why XML-Serializable class need a parameterless constructor
- Convert XML String to Object
- Using StringWriter for XML Serialization
- Using XmlSerializer to serialize derived classes
- XML Serialize generic list of serializable objects
- Most elegant XML serialization of Color structure
- Why are properties without a setter not serialized
- XML Serialization and Inherited Types
- .NET XML serialization gotchas? [closed]
- Force XmlSerializer to serialize DateTime as ‘YYYY-MM-DD hh:mm:ss’
- When a class is inherited from List, XmlSerializer doesn’t serialize other attributes
- How can I make the xmlserializer only serialize plain xml?
- How to XML-serialize a dictionary
- XmlSerializer serialize generic List of interface
- How can I serialize internal classes using XmlSerializer?
- XmlSerialize a custom collection with an Attribute
- using XmlArrayItem attribute without XmlArray on Serializable C# class
- Checking if an object is a number
- Ignore a property during xml serialization but not during deserialization
- XML Serialization question – How to Serialize Element, Attribute and Text from One Object
- How can I transform XML into a List or String[]?
- WCF chokes on properties with no “set “. Any workaround?
- Force XML serialization to serialize readonly property
- Slow SoapHttpClientProtocol constructor
- Using generics with XmlSerializer
- Prevent timezone conversion on deserialization of DateTime value