MoveToId() public abstract method

public abstract MoveToId ( string id ) : bool
id string
return bool
        public override object Evaluate(BaseIterator iter)
        {
            String strArgs;
            object val = arg0.Evaluate(iter);

            XPathNodeIterator valItr = val as XPathNodeIterator;

            if (valItr != null)
            {
                strArgs = "";
                while (valItr.MoveNext())
                {
                    strArgs += valItr.Current.Value + " ";
                }
            }
            else
            {
                strArgs = XPathFunctions.ToString(val);
            }

            XPathNavigator n       = iter.Current.Clone();
            ArrayList      rgNodes = new ArrayList();

            string [] ids = strArgs.Split(rgchWhitespace);
            for (int i = 0; i < ids.Length; i++)
            {
                if (n.MoveToId(ids [i]))
                {
                    rgNodes.Add(n.Clone());
                }
            }

            rgNodes.Sort(XPathNavigatorComparer.Instance);
            return(new ListIterator(iter, rgNodes));
        }
Exemplo n.º 2
0
        public override object Evaluate(BaseIterator iter)
        {
            object            obj = this.arg0.Evaluate(iter);
            XPathNodeIterator xpathNodeIterator = obj as XPathNodeIterator;
            string            text;

            if (xpathNodeIterator != null)
            {
                text = string.Empty;
                while (xpathNodeIterator.MoveNext())
                {
                    XPathNavigator xpathNavigator = xpathNodeIterator.Current;
                    text = text + xpathNavigator.Value + " ";
                }
            }
            else
            {
                text = XPathFunctions.ToString(obj);
            }
            XPathNavigator xpathNavigator2 = iter.Current.Clone();
            ArrayList      arrayList       = new ArrayList();

            string[] array = text.Split(XPathFunctionId.rgchWhitespace);
            for (int i = 0; i < array.Length; i++)
            {
                if (xpathNavigator2.MoveToId(array[i]))
                {
                    arrayList.Add(xpathNavigator2.Clone());
                }
            }
            arrayList.Sort(XPathNavigatorComparer.Instance);
            return(new ListIterator(iter, arrayList));
        }
Exemplo n.º 3
0
 void ProcessIds(XPathNavigator contextNode, string val) {
     string[] ids = XmlConvert.SplitString(val);
     for (int idx = 0; idx < ids.Length; idx++) {
         if (contextNode.MoveToId(ids[idx])) {
             Insert(outputBuffer, contextNode);
         }
     }
 }
 private void ProcessIds(XPathNavigator contextNode, string val)
 {
     string[] strArray = XmlConvert.SplitString(val);
     for (int i = 0; i < strArray.Length; i++)
     {
         if (contextNode.MoveToId(strArray[i]))
         {
             base.Insert(base.outputBuffer, contextNode);
         }
     }
 }
Exemplo n.º 5
0
        internal override XPathNavigator advance()
        {
            switch (m_qyInput.ReturnType())
            {
            case XPathResultType.NodeSet:
                if (ElementList == null)
                {
                    ElementList = new ArrayList();
                    XPathNavigator temp;
                    while ((temp = m_qyInput.advance()) != null)
                    {
                        if (_context.MoveToId(temp.Value))
                        {
                            AddToStack(_context.Clone());
                        }
                    }
                    strcount = ElementList.Count;
                }
                Debug.Assert(strcount >= 0);
                if (strcount != 0)
                {
                    return(ElementList[--strcount] as XPathNavigator);
                }
                return(null);

            case XPathResultType.String:
                if (ElementList == null)
                {
                    String   str = (String)m_qyInput.getValue(_context, null);                        char[] a = { ' ' };
                    String[] strarray = str.Split(null);
                    ElementList = new ArrayList();
                    while (strcount < strarray.Length)
                    {
                        if (_context.MoveToId(strarray[strcount++]))
                        {
                            AddToStack(_context.Clone());
                        }
                    }
                    strcount = ElementList.Count;
                }
                Debug.Assert(strcount >= 0);

                if (strcount != 0)
                {
                    return(ElementList[--strcount] as XPathNavigator);
                }
                return(null);

            case XPathResultType.Number:
                if (strcount == 0 && _context.MoveToId(StringFunctions.toString((double)m_qyInput.getValue(_context, null))))
                {
                    strcount = 1;
                    return(_context);
                }
                else
                {
                    return(null);
                }

            case XPathResultType.Boolean:
                if (strcount == 0 && _context.MoveToId(StringFunctions.toString((Boolean)m_qyInput.getValue(_context, null))))
                {
                    strcount = 1;
                    return(_context);
                }
                else
                {
                    return(null);
                }
            }
            return(null);
        } // Advance