System.Xml.Serialization.XmlAttributes.XmlText Property

Gets or sets an object that instructs the System.Xml.Serialization.XmlSerializer to serialize a public field or public read/write property as XML text.

Syntax

public XmlTextAttribute XmlText { get; set; }

Value

Documentation for this section has not yet been entered.

Remarks

By default, a public field or public read/write property is serialized as an XML element by the System.Xml.Serialization.XmlSerializer. However, it can force the field or property to be serialized as XML text by applying an System.Xml.Serialization.XmlTextAttribute to the field or property.

Note:

The System.Xml.Serialization.XmlTextAttribute cannot be applied to a field or property that returns an array.

To override the default serialization of a field or property (that does not return an array), create an System.Xml.Serialization.XmlTextAttribute and assign it to the XmlAttributes.XmlText property of an System.Xml.Serialization.XmlAttributes object. Add the System.Xml.Serialization.XmlAttributes object to an System.Xml.Serialization.XmlAttributeOverrides object and specify the type of the object that contains the overridden field or property, and the name of the overridden field or property.

Requirements

Namespace: System.Xml.Serialization
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0