XmlSerializerNamespaces.ToArray Method ()


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets the array of prefix and namespace pairs in an XmlSerializerNamespaces object.

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

public XmlQualifiedName[] ToArray()

Return Value

Type: System.Xml.XmlQualifiedName[]

An array of XmlQualifiedName objects that are used as qualified names in an XML document.

The following example prints each Name and Namespace in an XmlSerializerNamespaces object.

private void PrintNamespacePairs(XmlSerializerNamespaces namespaces)
   XmlQualifiedName[] qualifiedNames = namespaces.ToArray();
   for(int i = 0; i < qualifiedNames.Length; i++)
      qualifiedNames[i].Name + "\t" +

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top