internal static bool ExtractFromNavigator(XPathNavigator nav)
        {
            string str = XPathMessageFunctionActor.ExtractFromNavigator(nav);

            if (str.Length != 0)
            {
                nav.MoveToRoot();
                if (!nav.MoveToFirstChild())
                {
                    return(false);
                }
                if (nav.LocalName == "Envelope")
                {
                    if (nav.NamespaceURI == "http://schemas.xmlsoap.org/soap/envelope/")
                    {
                        return(str == S11Next);
                    }
                    if (nav.NamespaceURI == "http://www.w3.org/2003/05/soap-envelope")
                    {
                        return(str == S12Next);
                    }
                }
            }
            return(false);
        }
        internal override void InvokeInternal(ProcessingContext context, int argCount)
        {
            StackFrame             topArg      = context.TopArg;
            SeekableXPathNavigator contextNode = context.Processor.ContextNode;
            long currentPosition = contextNode.CurrentPosition;

            while (topArg.basePtr <= topArg.endPtr)
            {
                string       str = context.PeekString(topArg.basePtr);
                NodeSequence val = context.CreateSequence();
                if (XPathMessageFunction.MoveToHeader(contextNode) && contextNode.MoveToFirstChild())
                {
                    do
                    {
                        long   num2 = contextNode.CurrentPosition;
                        string str2 = XPathMessageFunctionActor.ExtractFromNavigator(contextNode);
                        contextNode.CurrentPosition = num2;
                        if (str2 == str)
                        {
                            val.Add(contextNode);
                        }
                    }while (contextNode.MoveToNext());
                }
                context.SetValue(context, topArg.basePtr, val);
                topArg.basePtr++;
            }
            contextNode.CurrentPosition = currentPosition;
        }