PopScope Method
Collapse the table of content
Expand the table of content

XmlNamespaceManager.PopScope Method

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

Pops a namespace scope off the stack.

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

'Declaration
Public Overridable Function PopScope As Boolean

Return Value

Type: System.Boolean
true if there are namespace scopes left on the stack; false if there are no more namespaces to pop.

When you call this method, all namespaces which were added to XmlNamespaceManager (by calling AddNamespace) since the last call to PopScope are removed.


' Create the XmlNamespaceManager.
Dim nt As New NameTable()
Dim nsmgr As New XmlNamespaceManager(nt)

Dim output As New StringBuilder()

' Add prefix/namespace pairs to the XmlNamespaceManager.
nsmgr.AddNamespace("", "www.wideworldimporters.com") 'Adds a default namespace.
nsmgr.AddNamespace("europe", "www.wideworldimporters.com/europe")
nsmgr.PushScope() 'Pushes a namespace scope on the stack.
nsmgr.AddNamespace("", "www.lucernepublishing.com") 'Adds another default namespace.
nsmgr.AddNamespace("partners", "www.lucernepublishing.com/partners")

output.AppendLine("Show all the prefix/namespace pairs in the XmlNamespaceManager...")

Do
    Dim prefix As String
    For Each prefix In nsmgr
        output.AppendLine(("Prefix=" + prefix + " Namespace=" + nsmgr.LookupNamespace(prefix)))
    Next prefix
Loop While nsmgr.PopScope()

OutputTextBlock.Text = output.ToString()


Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft