示例#1
0
        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;
            }
        }
示例#2
0
        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;
        }
示例#3
0
        //
        // 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);
        }
示例#4
0
 internal InputScope PushScope() {
     this.scopeStack = new InputScope(this.scopeStack);
     return this.scopeStack;
 }
示例#5
0
        private XPathNavigator navigator;    // We need this nsvigator for document() function implementation

        public InputScopeManager(XPathNavigator navigator, InputScope rootScope) {
            this.navigator = navigator;
            this.scopeStack = rootScope;
        }
示例#6
0
 internal InputScope(InputScope parent) {
     Init(parent);
 }
示例#7
0
 internal NavigatorInput(IXPathNavigable doc, string baseUri, InputScope rootScope): this( doc.CreateNavigator(), baseUri, rootScope) {}
示例#8
0
        //
        // 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();
            }
        }
示例#9
0
 internal InputScope PushScope()
 {
     this.scopeStack = new InputScope(this.scopeStack);
     return(this.scopeStack);
 }
示例#10
0
        private XPathNavigator navigator;    // We need this nsvigator for document() function implementation

        public InputScopeManager(XPathNavigator navigator, InputScope rootScope)
        {
            this.navigator  = navigator;
            this.scopeStack = rootScope;
        }
示例#11
0
 internal InputScope(InputScope parent)
 {
     Init(parent);
 }