System.Xml.Xsl.XsltOld.Compiler.PushNamespaceScope C# (CSharp) Method

PushNamespaceScope() private method

private PushNamespaceScope ( ) : void
return void
        internal void PushNamespaceScope()
        {
            _scopeManager.PushScope();
            NavigatorInput input = Input;

            if (input.MoveToFirstNamespace())
            {
                do
                {
                    _scopeManager.PushNamespace(input.LocalName, input.Value);
                }
                while (input.MoveToNextNamespace());
                input.ToParent();
            }
        }

Usage Example

        private void CompileContent(Compiler compiler) {
            NavigatorInput input = compiler.Input;
            
            if (compiler.Recurse()) {
                do {
                    switch(input.NodeType) {
                    case XPathNodeType.Element:
                        compiler.PushNamespaceScope();
                        string nspace = input.NamespaceURI;
                        string name   = input.LocalName;

                        if (Ref.Equal(nspace, input.Atoms.UriXsl) && Ref.Equal(name, input.Atoms.WithParam)) {
                                WithParamAction par = compiler.CreateWithParamAction();
                                CheckDuplicateParams(par.Name);
                                AddAction(par);
                        }
                        else {
                            throw compiler.UnexpectedKeyword();
                        }
                        compiler.PopScope();
                        break;
                    case XPathNodeType.Comment:
                    case XPathNodeType.ProcessingInstruction:
                    case XPathNodeType.Whitespace:
                    case XPathNodeType.SignificantWhitespace:
                        break;
                    default:
                        throw XsltException.Create(Res.Xslt_InvalidContents, "call-template");
                    }
                } while(compiler.Advance());

                compiler.ToParent();
            }
        }
All Usage Examples Of System.Xml.Xsl.XsltOld.Compiler::PushNamespaceScope