Example #1
0
 internal override IQuery Clone()
 {
     if (_op != Operator.Op.NEGATE)
     {
         return(new NumericExpr(_op, _opnd1.Clone(), _opnd2.Clone()));
     }
     else
     {
         return(new NumericExpr(_op, _opnd1.Clone(), null));
     }
 }
Example #2
0
        internal override IQuery Clone()
        {
            OrQuery clone = new OrQuery(qy1.Clone(), qy2.Clone(), false);

            clone.context = this.context;
            return(clone);
        }
Example #3
0
 internal IQuery CloneInput()
 {
     if (m_qyInput != null)
     {
         return(m_qyInput.Clone());
     }
     return(null);
 }
 internal override IQuery Clone()
 {
     if (_qy != null)
     {
         return(new NumberFunctions(_qy.Clone(), _FuncType));
     }
     else
     {
         return(new NumberFunctions(null, _FuncType));
     }
 }
Example #5
0
        internal override IQuery Clone()
        {
            MethodOperand method = (_Opnd != null) ?
                                   new MethodOperand(_Opnd.Clone(), _FType) :
                                   new MethodOperand(null, _FType)
            ;

            method.checkWhitespace = this.checkWhitespace;
            method.context         = this.context;
            return(method);
        }
Example #6
0
 internal override IQuery Clone()
 {
     if (_VarQuery == null)
     {
         return(new VariableQuery(Name, Prefix));
     }
     else
     {
         return(new VariableQuery(Name, Prefix, _VarQuery.Clone()));
     }
 }
Example #7
0
        internal SortQuery(SortQuery originalQuery)
        {
            this._qyInput = originalQuery._qyInput.Clone();
            int count = originalQuery._sortExpressions.Count;

            this._sortExpressions = new ArrayList(count);
            for (int i = 0; i < count; i++)
            {
                IQuery query = originalQuery._sortExpressions[i] as IQuery;
                query = query.Clone();
                this._sortExpressions.Add(query);
            }
            this._comparers = new ArrayList(originalQuery._comparers);
            this._Results   = new SortedList(new XPathComparer(_comparers));
            //            SetXsltContext(_context);
        }
 internal override IQuery Clone()
 {
     ArrayList argsClone = (ArrayList)_ArgList.Clone(); {
         for (int i = 0; i < _ArgList.Count; i++)
         {
             argsClone[i] = ((IQuery)_ArgList[i]).Clone();
         }
     }
     XsltFunction clone = new XsltFunction(_Prefix, _Name, argsClone); {
         if (_ResultQuery != null)
         {
             clone._ResultQuery = _ResultQuery.Clone();
         }
         clone._XsltContext   = _XsltContext;
         clone.functionToCall = functionToCall;
     }
     return(clone);
 }
Example #9
0
 internal override IQuery Clone()
 {
     return(new MergeFilterQuery(CloneInput(), _child.Clone()));
 }
 public override ResetableIterator MakeNewCopy()
 {
     return(new XPathSelectionIterator(nav.Clone(), query.Clone()));
 }
Example #11
0
        internal override object getValue(IQuery qyContext)
        {
            XPathNavigator eNext;

            switch (_FType)
            {
            case FT.FuncPosition:
                if (qyContext != null)
                {
                    return((double)qyContext.Position);
                }
                break;

            case FT.FuncLast:
                if (qyContext != null)
                {
                    if (checkWhitespace)
                    {
                        return((double)((PositionQuery)qyContext).getNonWSCount(context));
                    }
                    try {
                        return((double)((PositionQuery)qyContext).getCount());
                    }
                    catch (Exception) {
                        if (last == -1)
                        {
                            last = 0;
                            IQuery temp = qyContext.Clone();
                            while (temp.advance() != null)
                            {
                                last++;
                            }
                        }
                        return(last);
                    }
                }
                break;

            case FT.FuncCount:
                int i = 0;
                _Opnd.setContext(qyContext.peekElement());
                if (checkWhitespace)
                {
                    XPathNavigator nav;
                    while ((nav = _Opnd.advance()) != null)
                    {
                        if (nav.NodeType != XPathNodeType.Whitespace || context.PreserveWhitespace(nav))
                        {
                            i++;
                        }
                    }
                    return((double)i);
                }
                while (_Opnd.advance() != null)
                {
                    i++;
                }
                return((double)i);

            case FT.FuncNameSpaceUri:
                if (_Opnd != null)
                {
                    _Opnd.setContext(qyContext.peekElement());
                    if ((eNext = _Opnd.advance()) != null)
                    {
                        return(eNext.NamespaceURI);
                    }
                    else
                    {
                        return(String.Empty);
                    }
                }
                return(qyContext.peekElement().NamespaceURI);

            case FT.FuncLocalName:
                if (_Opnd != null)
                {
                    _Opnd.setContext(qyContext.peekElement().Clone());
                    if ((eNext = _Opnd.advance()) != null)
                    {
                        return(eNext.LocalName);
                    }
                    else
                    {
                        return(String.Empty);
                    }
                }
                return(qyContext.peekElement().LocalName);

            case FT.FuncName:
                if (_Opnd != null)
                {
                    _Opnd.setContext(qyContext.peekElement().Clone());
                    if ((eNext = _Opnd.advance()) != null)
                    {
                        return(eNext.Name);
                    }
                    else
                    {
                        return(String.Empty);
                    }
                }
                return(qyContext.peekElement().Name);
            }
            return(String.Empty);
        }
 public override ResetableIterator MakeNewCopy()
 {
     return(new XPathQueryIterator(query.Clone(), nav.Clone()));
 }
Example #13
0
        internal override object getValue( IQuery  qyContext) {
            XPathNavigator eNext;
            switch (_FType) {
                
                case FT.FuncPosition:
                    if (qyContext != null) {
                        return (double)qyContext.Position;
                    }
                    break;
                case FT.FuncLast:
                    if (qyContext != null) {
                        if (checkWhitespace) {
                            return(double)((PositionQuery)qyContext).getNonWSCount(context);
                        }
                        try {
                            return(double)((PositionQuery)qyContext).getCount();
                        }
                        catch(Exception) {
                            if (last == -1) {
                                last = 0;
                                IQuery temp = qyContext.Clone();
                                while (temp.advance() != null) {
                                    last++;
                                }
                            }
                            return last;
                        }
                    }
                    break;
                case FT.FuncCount:
                    int i = 0;
                    _Opnd.setContext(qyContext.peekElement());
                    if (checkWhitespace) {
                        XPathNavigator nav;
                        while ((nav = _Opnd.advance())!= null) {
                            if (nav.NodeType != XPathNodeType.Whitespace || context.PreserveWhitespace(nav)) { 
                                i++;
                            }
                        }
                        return (double)i;
                    }
                    while (_Opnd.advance()!= null) {
                        i++;
                    }
                    return (double)i;
                case FT.FuncNameSpaceUri:
                    if (_Opnd != null) {
                        _Opnd.setContext(qyContext.peekElement());
                        if (( eNext = _Opnd.advance()) != null) {
                            return eNext.NamespaceURI;
                        }
                        else {
                            return String.Empty;
                        }
                    }
                    return qyContext.peekElement().NamespaceURI;

                case FT.FuncLocalName:
                    if (_Opnd != null) {
                        _Opnd.setContext(qyContext.peekElement().Clone());
                        if (( eNext = _Opnd.advance()) != null) {
                            return eNext.LocalName;
                        }
                        else {
                            return String.Empty;
                        }
                    }
                    return qyContext.peekElement().LocalName;

                case FT.FuncName :
                    if (_Opnd != null) {
                        _Opnd.setContext(qyContext.peekElement().Clone());
                        if (( eNext = _Opnd.advance()) != null) {
                            return eNext.Name;
                        }
                        else {
                            return String.Empty;
                        }
                    }
                    return qyContext.peekElement().Name;

            }
            return String.Empty;
        }
Example #14
0
 internal override IQuery Clone()
 {
     return(new FilterQuery(CloneInput(), _opnd.Clone(), this.noPosition));
 }
Example #15
0
 internal override IQuery Clone()
 {
     return(new FilterQuery(m_qyInput.Clone(), _opnd.Clone(), this.noPosition));
     //return new FilterQuery(m_qyInput.Clone(), _opnd.Clone());
 }