XmlElementAttribute.Namespace Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the namespace assigned to the XML element that results when the class is serialized.
public:
property System::String ^ Namespace { System::String ^ get(); void set(System::String ^ value); };
public string Namespace { get; set; }
public string? Namespace { get; set; }
member this.Namespace : string with get, set
Public Property Namespace As String
Property Value
The namespace of the XML element.
Remarks
The Namespace property conforms to the World Wide Web Consortium specification, Namespaces in XML.
To create namespaces that are associated with a prefix, you must create an XmlSerializerNamespaces that contains the namespaces and prefixes used in the XML document. As you set the namespace for each XmlArrayAttribute, it must match one of the namespaces in the XmlSerializerNamespaces. When the XML is generated, each array is correctly prefixed with the prefix associated with the specified namespace.