This API supports the product infrastructure and is not intended to be used directly from your code.
Initializes a new instance of the XmlSerializerNamespaces class, using the specified instance of XmlSerializerNamespaces containing the collection of prefix and namespace pairs.

The XmlSerializerNamespaces contains a collection of XML namespaces, each with an associated prefix. The XmlSerializer uses an instance of the XmlSerializerNamespaces class to create qualified names in an XML document.

XML namespaces contained by the XmlSerializerNamespaces must conform to the www.w3.org specification named Namespaces in XML.

XML namespaces provide a way to qualify the names of XML elements and attributes in XML documents. A qualified name consists of a prefix and a local name, separated by a colon. The prefix functions only as a placeholder; it is mapped to a URI that specifies a namespace. The combination of the universally-managed URI namespace and the local name produces a name that is guaranteed to be universally unique.

The following example creates an XmlSerializerNamespaces object, and adds two prefix and namespace pairs to it. The example then passes the XmlSerializerNamespaces to the Serialize method, which serializes a Books object into an XML document. Using the XmlSerializerNamespaces object, the Serialize method qualifies each XML element and attribute with one of the two namespaces.