Add Method
Collapse the table of content
Expand the table of content

XmlSerializerNamespaces.Add Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Adds a prefix and namespace pair to an XmlSerializerNamespaces object.

Namespace:  System.Xml.Serialization
Assembly:  System.Xml.Serialization (in System.Xml.Serialization.dll)

public void Add(
	string prefix,
	string ns
)

Parameters

prefix
Type: System.String
The prefix associated with an XML namespace.
ns
Type: System.String
An XML namespace.

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

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

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2016 Microsoft