System.Xml.Serialization.XmlSerializerNamespaces.Add Method

Adds a prefix and namespace pair to an System.Xml.Serialization.XmlSerializerNamespaces object.

Syntax

public void Add (string prefix, string ns)

Parameters

prefix
The prefix associated with an XML namespace.
ns
An XML namespace.

Remarks

If you want the System.Xml.Serialization.XmlSerializer to qualify the element and attribute names in an XML document, you must XmlSerializerNamespaces.Add(string, string) the prefix and namespace pairs to an System.Xml.Serialization.XmlSerializerNamespaces object.

Any namespaces that you add must conform to the www.w3.org specification Namespaces in XML.

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