internal GenericSeekableNavigator(GenericSeekableNavigator navigator)
 {
     this.navigator = navigator.navigator.Clone();
     this.nodes = new QueryBuffer<XPathNavigator>();
     this.currentPosition = navigator.currentPosition;
     this.dom = navigator.dom;
 }
 internal GenericSeekableNavigator(XPathNavigator navigator)
 {
     this.navigator = navigator;
     this.nodes = new QueryBuffer<XPathNavigator>(4);
     this.currentPosition = -1L;
     this.dom = this;
 }
Esempio n. 3
0
 internal GenericSeekableNavigator(XPathNavigator navigator)
 {
     this.navigator       = navigator;
     this.nodes           = new QueryBuffer <XPathNavigator>(4);
     this.currentPosition = -1;
     this.dom             = this;
 }
Esempio n. 4
0
 internal GenericSeekableNavigator(GenericSeekableNavigator navigator)
 {
     this.navigator       = navigator.navigator.Clone();
     this.nodes           = default(QueryBuffer <XPathNavigator>);
     this.currentPosition = navigator.currentPosition;
     this.dom             = navigator.dom;
 }
Esempio n. 5
0
        public override bool IsSamePosition(XPathNavigator other)
        {
            GenericSeekableNavigator nav = other as GenericSeekableNavigator;

            if (null != nav)
            {
                return(this.navigator.IsSamePosition(nav.navigator));
            }
            return(false);
        }
        public override bool IsDescendant(XPathNavigator navigator)
        {
            if (navigator == null)
            {
                return(false);
            }
            GenericSeekableNavigator navigator2 = navigator as GenericSeekableNavigator;

            return((navigator2 != null) && this.navigator.IsDescendant(navigator2.navigator));
        }
        public override bool MoveTo(XPathNavigator other)
        {
            GenericSeekableNavigator navigator = other as GenericSeekableNavigator;

            if ((navigator != null) && this.navigator.MoveTo(navigator.navigator))
            {
                this.currentPosition = navigator.currentPosition;
                return(true);
            }
            return(false);
        }
 public override XmlNodeOrder ComparePosition(XPathNavigator navigator)
 {
     if (navigator != null)
     {
         GenericSeekableNavigator navigator2 = navigator as GenericSeekableNavigator;
         if (navigator2 != null)
         {
             return(this.navigator.ComparePosition(navigator2.navigator));
         }
     }
     return(XmlNodeOrder.Unknown);
 }
Esempio n. 9
0
        public override bool IsDescendant(XPathNavigator navigator)
        {
            if (navigator == null)
            {
                return(false);
            }

            GenericSeekableNavigator nav = navigator as GenericSeekableNavigator;

            if (null != nav)
            {
                return(this.navigator.IsDescendant(nav.navigator));
            }
            return(false);
        }
        public override bool IsSamePosition(XPathNavigator other)
        {
            GenericSeekableNavigator navigator = other as GenericSeekableNavigator;

            return((navigator != null) && this.navigator.IsSamePosition(navigator.navigator));
        }
        public override object Invoke(XsltContext xsltContext, object[] args, XPathNavigator docContext)
        {
            string actor = ToString(args[0]);
            string e = string.Format(CultureInfo.InvariantCulture, "/s11:Envelope/s11:Header/*[@s11:actor='{0}'] | /s12:Envelope/s12:Header/*[@s12:role='{1}']", actor, actor);
            XPathExpression expr = docContext.Compile(e);
            expr.SetContext(xsltContext);
            return docContext.Evaluate(expr);

#if NO
            // PERF, [....], I drafted this implementation before we found out that a bug in the Fx implementation would 
            //               prevent us from constructing an XPathNodeIterator that they would accept.  I'm keeping it
            //               around in the hope that I will be able to use it by M5.4.  If not, it will be deleted.
            
            XPathNavigator basicNav = docContext.Clone();
            SeekableXPathNavigator nav = basicNav as SeekableXPathNavigator;
            if(nav == null)
            {
                nav = new GenericSeekableNavigator(basicNav);
            }
            
            string actor = (string)args[0];
            NodeSequence seq = new NodeSequence();
            XPathNodeIterator result = new NodeSequenceIterator(seq);
            
            nav.MoveToRoot();
            if(!nav.MoveToFirstChild())
            {
                return result;
            }

            if(nav.LocalName != "Envelope")
            {
                return result;
            }
            
            if(nav.NamespaceURI == XPathMessageContext.S11NS)
            {
                // Move to Header
                if(nav.MoveToFirstChild() && nav.LocalName == "Header" && nav.NamespaceURI == XPathMessageContext.S11NS)
                {
                    // Move to first Header block
                    if(nav.MoveToFirstChild())
                    {
                        // Iterate over header blocks
                        do
                        {
                            if(nav.MoveToAttribute("actor", XPathMessageContext.S11NS))
                            {
                                if(nav.Value == actor)
                                {
                                    seq.Add(nav);
                                }
                                nav.MoveToParent();
                            }
                                    
                        } while(nav.MoveToNext());
                    }
                }
            }
            else if(nav.NamespaceURI == XPathMessageContext.S12NS)
            {
                // Move to Header
                if(nav.MoveToFirstChild() && nav.LocalName == "Header" && nav.NamespaceURI == XPathMessageContext.S12NS)
                {
                    // Move to first Header block
                    if(nav.MoveToFirstChild())
                    {
                        // Iterate over header blocks
                        do
                        {
                            if(nav.MoveToAttribute("role", XPathMessageContext.S12NS))
                            {
                                if(nav.Value == actor)
                                {
                                    seq.Add(nav);
                                }
                                nav.MoveToParent();
                            }
                                    
                        } while(nav.MoveToNext());
                    }
                }
            }

            return result;
#endif
        }