protected void CompileOnceTemplate(Compiler compiler) { NavigatorInput input = compiler.Input; if (input.NodeType == XPathNodeType.Element) { string nspace = input.NamespaceURI; if (Ref.Equal(nspace, input.Atoms.UriXsl)) { compiler.PushNamespaceScope(); CompileInstruction(compiler); compiler.PopScope(); } else { compiler.PushLiteralScope(); compiler.InsertExtensionNamespace(); if (compiler.IsExtensionNamespace(nspace)) { AddAction(compiler.CreateNewInstructionAction()); } else { CompileLiteral(compiler); } compiler.PopScope(); } } else { CompileLiteral(compiler); } }
private void CompileLiteralAttributesAndNamespaces(Compiler compiler) { NavigatorInput input = compiler.Input; if (input.Navigator.MoveToAttribute("use-attribute-sets", input.Atoms.UriXsl)) { AddAction(compiler.CreateUseAttributeSetsAction()); input.Navigator.MoveToParent(); } compiler.InsertExcludedNamespace(); if (input.MoveToFirstNamespace()) { do { string uri = input.Value; if (uri == XmlReservedNs.NsXslt) { continue; } if ( compiler.IsExcludedNamespace(uri) || compiler.IsExtensionNamespace(uri) || compiler.IsNamespaceAlias(uri) ) { continue; } this.AddEvent(new NamespaceEvent(input)); }while (input.MoveToNextNamespace()); input.ToParent(); } if (input.MoveToFirstAttribute()) { do { // Skip everything from Xslt namespace if (Ref.Equal(input.NamespaceURI, input.Atoms.UriXsl)) { 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(); } }
void CompileLiteralAttributesAndNamespaces(Compiler compiler) { NavigatorInput input = compiler.Input; if (input.Navigator.MoveToAttribute("use-attribute-sets", input.Atoms.UriXsl)) { AddAction(compiler.CreateUseAttributeSetsAction()); input.Navigator.MoveToParent(); } compiler.InsertExcludedNamespace(); if (input.MoveToFirstNamespace()) { do { string uri = input.Value; if (uri == XmlReservedNs.NsXslt) { continue; } if ( compiler.IsExcludedNamespace(uri) || compiler.IsExtensionNamespace(uri) || compiler.IsNamespaceAlias(uri) ) { continue; } this.AddEvent(new NamespaceEvent(input)); } while (input.MoveToNextNamespace()); input.ToParent(); } if (input.MoveToFirstAttribute()) { do { // Skip everything from Xslt namespace if (Ref.Equal(input.NamespaceURI, input.Atoms.UriXsl)) { 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(); } }