System.Xml.Xsl.XsltOld.CopyNodeSetAction.GetAction C# (CSharp) Method

GetAction() static private method

static private GetAction ( ) : CopyNodeSetAction
return CopyNodeSetAction
        internal static CopyNodeSetAction GetAction() {
            Debug.Assert(s_Action != null);
            return s_Action;
        }

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:
                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.CopyNodeSetAction::GetAction