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.
Assembly: System.Xml (in System.Xml.dll)
Return Value
Type: System.Booleantrue 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()
Show: