System.Xml.Xsl.XsltOld.Processor.PushActionFrame C# (CSharp) Method

PushActionFrame() private method

private PushActionFrame ( Action action, XPathNodeIterator nodeSet ) : void
action Action
nodeSet XPathNodeIterator
return void
        internal void PushActionFrame(Action action, XPathNodeIterator nodeSet) {
            ActionFrame frame = PushNewFrame();
            frame.Init(action, nodeSet);
        }

Same methods

Processor::PushActionFrame ( ActionFrame container ) : void
Processor::PushActionFrame ( ActionFrame container, XPathNodeIterator nodeSet ) : void

Usage Example

示例#1
0
        internal override void Execute(Processor processor, ActionFrame frame)
        {
            Debug.Assert(processor != null && frame != null);

            switch (frame.State)
            {
                case Initialized:
                    Debug.Assert(frame.NodeSet != null);
                    Query query = processor.GetValueQuery(_selectKey);
                    object result = query.Evaluate(frame.NodeSet);

                    if (result is XPathNodeIterator)
                    {
                        // we cash this query because otherwise current() works incorrectly. Bug#382166.
                        // To be perfect we should use frame.NewNodeSet here
                        processor.PushActionFrame(CopyNodeSetAction.GetAction(), new XPathArrayIterator(query));
                        frame.State = NodeSetCopied;
                        break;
                    }

                    XPathNavigator nav = result as XPathNavigator;
                    if (nav != null)
                    {
                        processor.PushActionFrame(CopyNodeSetAction.GetAction(), new XPathSingletonIterator(nav));
                        frame.State = NodeSetCopied;
                        break;
                    }

                    string value = XmlConvert.ToXPathString(result);
                    if (processor.TextEvent(value))
                    {
                        frame.Finished();
                    }
                    else
                    {
                        frame.StoredOutput = value;
                        frame.State = ResultStored;
                    }
                    break;

                case ResultStored:
                    Debug.Assert(frame.StoredOutput != null);
                    processor.TextEvent(frame.StoredOutput);
                    frame.Finished();
                    break;

                case NodeSetCopied:
                    Debug.Assert(frame.State == NodeSetCopied);
                    frame.Finished();
                    break;
            }
        }
All Usage Examples Of System.Xml.Xsl.XsltOld.Processor::PushActionFrame