XmlNamespaceManager.GetEnumerator Method ()

 

Returns an enumerator to use to iterate through the namespaces in the XmlNamespaceManager.

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

public virtual IEnumerator GetEnumerator()

Return Value

Type: System.Collections.IEnumerator

An IEnumerator containing the prefixes stored by the XmlNamespaceManager.

The following code shows how to use the IEnumerator to view all the namespace pairs stored in the XmlNamespaceManager object.

Dim nsEnum As IEnumerator = nsmgr.GetEnumerator()
Do While nsEnum.MoveNext
  If nsEnum.Current <> "" Then
    MsgBox("xmlns:" + nsEnum.Current + "=" + nsmgr.LookupNamespace(nsEnum.Current))
  End If
Loop

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