System.Xml.Xsl.XsltOld.ActionFrame.NextNode C# (CSharp) Method

NextNode() private method

private NextNode ( Processor proc ) : bool
proc Processor
return bool
       internal bool NextNode(Processor proc) {
            bool next = this.nodeSet.MoveNext();
            if (next && proc.Stylesheet.Whitespace) {
                XPathNodeType type = this.nodeSet.Current.NodeType;
                if (type == XPathNodeType.Whitespace) {
                    XPathNavigator nav = this.nodeSet.Current.Clone();
                    bool flag;
                    do {
                        nav.MoveTo(this.nodeSet.Current);
                        nav.MoveToParent();
                        flag = ! proc.Stylesheet.PreserveWhiteSpace(proc, nav) && (next = this.nodeSet.MoveNext());
                        type = this.nodeSet.Current.NodeType;                    
                    }
                    while (flag && (type == XPathNodeType.Whitespace ));
                }
            }
            return next;
        }

Usage Example

Ejemplo n.º 1
0
        internal override void Execute(Processor processor, ActionFrame frame)
        {
            Debug.Assert(processor != null && frame != null);

            switch (frame.State)
            {
            case Initialized:
                frame.AllocateVariables(variableCount);
                XPathNavigator root = processor.Document.Clone();
                root.MoveToRoot();
                frame.InitNodeSet(new XPathSingletonIterator(root));

                if (this.containedActions != null && this.containedActions.Count > 0)
                {
                    processor.PushActionFrame(frame);
                }
                frame.State = QueryInitialized;
                break;

            case QueryInitialized:
                Debug.Assert(frame.State == QueryInitialized);
                frame.NextNode(processor);
                Debug.Assert(Processor.IsRoot(frame.Node));
                if (processor.Debugger != null)
                {
                    // this is like apply-templates, but we don't have it on stack.
                    // Pop the stack, otherwise last instruction will be on it.
                    processor.PopDebuggerStack();
                }
                processor.PushTemplateLookup(frame.NodeSet, /*mode:*/ null, /*importsOf:*/ null);

                frame.State = RootProcessed;
                break;

            case RootProcessed:
                Debug.Assert(frame.State == RootProcessed);
                frame.Finished();
                break;

            default:
                Debug.Fail("Invalid RootAction execution state");
                break;
            }
        }
All Usage Examples Of System.Xml.Xsl.XsltOld.ActionFrame::NextNode