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

CopyTextEvent() private method

private CopyTextEvent ( XPathNavigator node ) : bool
node XPathNavigator
return bool
        internal bool CopyTextEvent(XPathNavigator node) {
            switch (node.NodeType) {
            case XPathNodeType.Element:
            case XPathNodeType.Namespace:
                break;

            case XPathNodeType.Attribute:
            case XPathNodeType.ProcessingInstruction:
            case XPathNodeType.Comment:
            case XPathNodeType.Text:
            case XPathNodeType.Whitespace:
            case XPathNodeType.SignificantWhitespace:
                string text = node.Value;
                return TextEvent(text);

            case XPathNodeType.Root:
            case XPathNodeType.All:
                break;

            default:
                Debug.Fail("Invalid XPathNodeType in CopyTextEvent");
                break;
            }

            return true;
        }

Usage Example

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

            while (processor.CanContinue)
            {
                switch (frame.State)
                {
                case Initialized:
                    if (Processor.IsRoot(frame.Node !))
                    {
                        processor.PushActionFrame(frame);
                        frame.State = ChildrenOnly;
                        break;
                    }

                    if (processor.CopyBeginEvent(frame.Node !, _empty) == false)
                    {
                        // This event wasn't processed
                        break;
                    }
                    frame.State = NamespaceCopy;

                    continue;

                case NamespaceCopy:
                    frame.State = ContentsCopy;
                    if (frame.Node !.NodeType == XPathNodeType.Element)
                    {
                        processor.PushActionFrame(CopyNamespacesAction.GetAction(), frame.NodeSet);
                        break;
                    }
                    continue;

                case ContentsCopy:
                    if (frame.Node !.NodeType == XPathNodeType.Element && !_empty)
                    {
                        //Debug.Assert(frame.Node.HasValue == false);
                        processor.PushActionFrame(frame);
                        frame.State = ProcessChildren;
                        break;
                    }
                    else
                    {
                        if (processor.CopyTextEvent(frame.Node))
                        {
                            frame.State = ProcessChildren;
                            continue;
                        }
                        else
                        {
                            // This event wasn't processed
                            break;
                        }
                    }
All Usage Examples Of System.Xml.Xsl.XsltOld.Processor::CopyTextEvent