System.Xml.Xsl.Runtime.NamespaceIterator.Create C# (CSharp) Method

Create() public method

Initialize the NamespaceIterator.
public Create ( XPathNavigator context ) : void
context System.Xml.XPath.XPathNavigator
return void
        public void Create(XPathNavigator context) {
            // Push all of context's in-scope namespaces onto a stack in order to return them in document order
            // (MoveToXXXNamespace methods return namespaces in reverse document order)
            this.navStack.Reset();
            if (context.MoveToFirstNamespace(XPathNamespaceScope.All)) {
                do {
                    // Don't return the default namespace undeclaration
                    if (context.LocalName.Length != 0 || context.Value.Length != 0)
                        this.navStack.Push(context.Clone());
                }
                while (context.MoveToNextNamespace(XPathNamespaceScope.All));

                context.MoveToParent();
            }
        }
NamespaceIterator