예제 #1
0
        void CompileLiteralAttributesAndNamespaces(Compiler compiler)
        {
            NavigatorInput input = compiler.Input;

            if (input.Navigator.MoveToAttribute(Keywords.s_UseAttributeSets, input.Atoms.XsltNamespace))
            {
                AddAction(compiler.CreateUseAttributeSetsAction());
                input.Navigator.MoveToParent();
            }
            compiler.InsertExcludedNamespace();

            if (input.MoveToFirstAttribute())
            {
                do
                {
                    // Skip everything from Xslt namespace
                    if (Keywords.Equals(input.NamespaceURI, input.Atoms.XsltNamespace))
                    {
                        continue;
                    }

                    // Add attribute events
                    this.AddEvent(compiler.CreateBeginEvent());
                    this.AddEvents(compiler.CompileAvt(input.Value));
                    this.AddEvent(new EndEvent(XPathNodeType.Attribute));
                }while (input.MoveToNextAttribute());
                input.ToParent();
            }

            if (input.MoveToFirstNamespace())
            {
                do
                {
                    string uri = input.Value;

                    if (Keywords.Compare(uri, input.Atoms.XsltNamespace))
                    {
                        continue;
                    }
                    if (
                        compiler.IsExcludedNamespace(uri) ||
                        compiler.IsExtensionNamespace(uri) ||
                        compiler.IsNamespaceAlias(uri)
                        )
                    {
                        continue;
                    }
                    this.AddEvent(new NamespaceEvent(input));
                }while (input.MoveToNextNamespace());
                input.ToParent();
            }
        }
예제 #2
0
파일: compiler.cs 프로젝트: ydunk/masters
        internal void PushNamespaceScope()
        {
            this.scopeManager.PushScope();
            NavigatorInput input = Input;

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