Exemplo n.º 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;
            }
        }
Exemplo n.º 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;
        }
Exemplo n.º 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);
        }
Exemplo n.º 4
0
 internal InputScope PushScope() {
     this.scopeStack = new InputScope(this.scopeStack);
     return this.scopeStack;
 }
Exemplo n.º 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;
        }
Exemplo n.º 6
0
 internal InputScope(InputScope parent) {
     Init(parent);
 }
Exemplo n.º 7
0
 internal NavigatorInput(IXPathNavigable doc, string baseUri, InputScope rootScope): this( doc.CreateNavigator(), baseUri, rootScope) {}
Exemplo n.º 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();
            }
        }
Exemplo n.º 9
0
 internal InputScope PushScope()
 {
     this.scopeStack = new InputScope(this.scopeStack);
     return(this.scopeStack);
 }
Exemplo n.º 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;
        }
Exemplo n.º 11
0
 internal InputScope(InputScope parent)
 {
     Init(parent);
 }