internal void Init(InputScope parent) { this.scopes = null; this.parent = parent; if (this.parent != null) { this.forwardCompatibility = this.parent.forwardCompatibility; this.canHaveApplyImports = this.parent.canHaveApplyImports; } }
internal void PopScope() { Debug.Assert(this.scopeStack != null, "Push/Pop disbalance"); if (this.scopeStack == null) { return; } for (NamespaceDecl scope = this.scopeStack.Scopes; scope != null; scope = scope.Next) { Debug.WriteLine("Popping namespace scope : " + scope.Prefix + " : " + scope.Uri); this.defaultNS = scope.PrevDefaultNsUri; } this.scopeStack = this.scopeStack.Parent; }
// // The World of Compile // internal void Compile(NavigatorInput input, XmlResolver xmlResolver) { Debug.Assert(this.input == null && this.atoms == null); this.xmlResolver = xmlResolver == null ? new XmlUrlResolver() : xmlResolver; PushInputDocument(input, input.BaseURI); this.rootScope = this.scopeManager.PushScope(); this.queryStore = new ArrayList(); AddSpecialQueries(); try { this.rootStylesheet = new Stylesheet(); PushStylesheet(this.rootStylesheet); Debug.Assert(this.input != null && this.atoms != null); try { this.CreateRootAction(); } catch(Exception e) { throw new XsltCompileException(e, this.Input.BaseURI, this.Input.LineNumber, this.Input.LinePosition); } this.stylesheet.ProcessTemplates(); this.rootAction.PorcessAttributeSets(this.rootStylesheet); this.stylesheet.SortWhiteSpace(); CompileScript(); this.rootAction.SortVariables(); if (this.globalNamespaceAliasTable != null ) { this.stylesheet.ReplaceNamespaceAlias(this); this.rootAction.ReplaceNamespaceAlias(this); } } finally { PopInputDocument(); } Debug.Assert(this.rootAction != null); Debug.Assert(this.stylesheet != null); Debug.Assert(this.queryStore != null); Debug.Assert(this.input == null && this.atoms == null); }
internal InputScope PushScope() { this.scopeStack = new InputScope(this.scopeStack); return this.scopeStack; }
private XPathNavigator navigator; // We need this nsvigator for document() function implementation public InputScopeManager(XPathNavigator navigator, InputScope rootScope) { this.navigator = navigator; this.scopeStack = rootScope; }
internal InputScope(InputScope parent) { Init(parent); }
internal NavigatorInput(IXPathNavigable doc, string baseUri, InputScope rootScope): this( doc.CreateNavigator(), baseUri, rootScope) {}
// // Constructor // internal NavigatorInput(XPathNavigator navigator, string baseUri, InputScope rootScope) { if (navigator == null) { throw new ArgumentNullException("navigator"); } if (baseUri == null) { throw new ArgumentNullException("baseUri"); } Debug.Assert(navigator.NameTable != null); _Next = null; _Href = baseUri; _Atoms = new Keywords(navigator.NameTable); _Atoms.LookupKeywords(); _Navigator = navigator; _Manager = new InputScopeManager(_Navigator, rootScope); _PositionInfo = PositionInfo.GetPositionInfo(_Navigator); /*BeginReading:*/ AssertInput(); if (NodeType == XPathNodeType.Root) { _Navigator.MoveToFirstChild(); } }
internal InputScope PushScope() { this.scopeStack = new InputScope(this.scopeStack); return(this.scopeStack); }