MoveToChild() private method

private MoveToChild ( string name, string URN, int depth ) : bool
name string
URN string
depth int
return bool
Exemplo n.º 1
0
        public bool MoveToStartElement(string localname, string URN)
        {
            if (!this.isActive)
            {
                return(false);
            }
            this.currentDepth++;
            bool flag = false;

            for (int i = 0; i < this.axisStack.Count; i++)
            {
                AxisStack stack = (AxisStack)this.axisStack[i];
                if (stack.Subtree.IsSelfAxis)
                {
                    if (stack.Subtree.IsDss || (this.CurrentDepth == 0))
                    {
                        flag = true;
                    }
                }
                else if ((this.CurrentDepth != 0) && stack.MoveToChild(localname, URN, this.currentDepth))
                {
                    flag = true;
                }
            }
            return(flag);
        }
Exemplo n.º 2
0
        public bool MoveToStartElement(string localname, string?URN)
        {
            if (!_isActive)
            {
                return(false);
            }

            // for each:
            _currentDepth++;
            bool result = false;

            for (int i = 0; i < _axisStack.Count; ++i)
            {
                AxisStack stack = (AxisStack)_axisStack[i] !;
                // special case for self tree   "." | ".//."
                if (stack.Subtree.IsSelfAxis)
                {
                    if (stack.Subtree.IsDss || (this.CurrentDepth == 0))
                    {
                        result = true;
                    }
                    continue;
                }

                // otherwise if it's context node then return false
                if (this.CurrentDepth == 0)
                {
                    continue;
                }

                if (stack.MoveToChild(localname, URN, _currentDepth))
                {
                    result = true;
                    // even already know the last result is true, still need to continue...
                    // run everyone once
                }
            }

            return(result);
        }