Exemplo n.º 1
0
        /// <summary>
        /// Evaluate arguments.
        /// </summary>
        /// <param name="args">
        ///            argument expressions. </param>
        /// <exception cref="DynamicError">
        ///             Dynamic error. </exception>
        /// <returns> Result of evaluation. </returns>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public org.eclipse.wst.xml.xpath2.api.ResultSequence evaluate(java.util.Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws org.eclipse.wst.xml.xpath2.processor.DynamicError
        public override ResultSequence evaluate(ICollection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec)
        {
            Debug.Assert(args.Count == 2);

            // Iterator i = args.iterator();

            // return op_to( (ResultSequence) i.next(), (ResultSequence) i.next());
            return(op_to(args));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Evaluate arguments.
        /// </summary>
        /// <param name="args">
        ///            argument expressions. </param>
        /// <exception cref="DynamicError">
        ///             Dynamic error. </exception>
        /// <returns> Result of evaluation. </returns>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public org.eclipse.wst.xml.xpath2.api.ResultSequence evaluate(java.util.Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws org.eclipse.wst.xml.xpath2.processor.DynamicError
        public override ResultSequence evaluate(ICollection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec)
        {
            // 1 argument only!
            Debug.Assert(args.Count >= min_arity() && args.Count <= max_arity());
            var i = args.GetEnumerator();

            i.MoveNext();
            ResultSequence argument = (ResultSequence)args.GetEnumerator().Current;

            return(fn_round(argument));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Evaluate arguments.
        /// </summary>
        /// <param name="args">
        ///            argument expressions. </param>
        /// <exception cref="DynamicError">
        ///             Dynamic error. </exception>
        /// <returns> Result of evaluation. </returns>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public org.eclipse.wst.xml.xpath2.api.ResultSequence evaluate(java.util.Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws org.eclipse.wst.xml.xpath2.processor.DynamicError
        public override ResultSequence evaluate(ICollection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec)
        {
            var i = args.GetEnumerator();

            i.MoveNext();
            ResultSequence argument = (ResultSequence)i.Current;

            if (args.Count == 2)
            {
                return(fn_round_half_to_even(args));
            }

            return(fn_round_half_to_even(argument));
        }
Exemplo n.º 4
0
        /// <summary>
        /// Evaluate arguments.
        /// </summary>
        /// <param name="args">
        ///            argument expressions. </param>
        /// <exception cref="DynamicError">
        ///             Dynamic error. </exception>
        /// <returns> Result of evaluation. </returns>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public org.eclipse.wst.xml.xpath2.api.ResultSequence evaluate(java.util.Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws org.eclipse.wst.xml.xpath2.processor.DynamicError
        public override ResultSequence evaluate(ICollection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec)
        {
            // Differentiate depending on whether there is one (required) argument or whatever.
            ICollection cargs = Function.convert_arguments(args, args.Count == 1 ? expected_args1() : expected_args());

            QName          code        = null;
            ResultSequence items       = null;
            string         description = null;

            // Iterate over the args
            IEnumerator it = cargs.GetEnumerator();

            if (it.MoveNext())
            {
                ResultSequence rsQName = (ResultSequence)it.Current;
                // for arity 2 and 3, the code is not mandatory, as in fn:code((), "description). Handle this:
                if (!rsQName.empty())
                {
                    code = (QName)rsQName.first();
                }
            }
            // Next arg (if present) is the description
            if (it.MoveNext())
            {
                ResultSequence rsDescription = (ResultSequence)it.Current;
                description = ((XSString)rsDescription.first()).value();
            }
            // Final arg (if present) is the list of items
            if (it.MoveNext())
            {
                items = (ResultSequence)it.Current;
            }

            // Handle the code if missing
            if (code == null)
            {
                code = new QName("err", "FOER0000", "http://www.w3.org/2005/xqt-errors");
            }

            return(error(code, description, items));
        }
Exemplo n.º 5
0
        /// <summary>
        /// Evaluate arguments.
        /// </summary>
        /// <param name="args">
        ///            argument expressions. </param>
        /// <exception cref="DynamicError">
        ///             Dynamic error. </exception>
        /// <returns> Result of evaluation. </returns>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public org.eclipse.wst.xml.xpath2.api.ResultSequence evaluate(java.util.Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws org.eclipse.wst.xml.xpath2.processor.DynamicError
        public override ResultSequence evaluate(ICollection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec)
        {
            IEnumerator argIterator = args.GetEnumerator();

            argIterator.MoveNext();
            ResultSequence argSequence = (ResultSequence)argIterator.Current;
            AnyAtomicType  zero        = ZERO;

            if (argIterator.MoveNext())
            {
                ResultSequence zeroSequence = (ResultSequence)argIterator.Current;
                if (zeroSequence.size() != 1)
                {
                    throw new DynamicError(TypeError.invalid_type(null));
                }
                if (!(zeroSequence.first() is AnyAtomicType))
                {
                    throw new DynamicError(TypeError.invalid_type(zeroSequence.first().StringValue));
                }
                zero = (AnyAtomicType)zeroSequence.first();
            }
            return(sum(argSequence, zero));
        }
        /// <summary>
        /// Evaluate arguments.
        /// </summary>
        /// <param name="args">
        ///            argument expressions. </param>
        /// <exception cref="DynamicError">
        ///             Dynamic error. </exception>
        /// <returns> Result of evaluation. </returns>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public org.eclipse.wst.xml.xpath2.api.ResultSequence evaluate(java.util.Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws org.eclipse.wst.xml.xpath2.processor.DynamicError
        public override ResultSequence evaluate(ICollection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec)
        {
            return(timezone_from_date_time(args));
        }
Exemplo n.º 7
0
        /// <summary>
        /// Evaluate arguments.
        /// </summary>
        /// <param name="args">
        ///            argument expressions. </param>
        /// <exception cref="DynamicError">
        ///             Dynamic error. </exception>
        /// <returns> Result of evaluation. </returns>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public org.eclipse.wst.xml.xpath2.api.ResultSequence evaluate(java.util.Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws org.eclipse.wst.xml.xpath2.processor.DynamicError
        public override ResultSequence evaluate(ICollection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec)
        {
            return(node_name(args));
        }
Exemplo n.º 8
0
        /// <summary>
        /// Evaluate arguments.
        /// </summary>
        /// <param name="args">
        ///            argument expressions. </param>
        /// <exception cref="DynamicError">
        ///             Dynamic error. </exception>
        /// <returns> Result of evaluation. </returns>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public org.eclipse.wst.xml.xpath2.api.ResultSequence evaluate(java.util.Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws org.eclipse.wst.xml.xpath2.processor.DynamicError
        public override ResultSequence evaluate(ICollection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec)
        {
            return(codepoints_to_string(args));
        }
Exemplo n.º 9
0
        /// <summary>
        /// Evaluate arguments.
        /// </summary>
        /// <param name="args">
        ///            argument expressions. </param>
        /// <exception cref="DynamicError">
        ///             Dynamic error. </exception>
        /// <returns> Result of evaluation. </returns>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public org.eclipse.wst.xml.xpath2.api.ResultSequence evaluate(java.util.Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws org.eclipse.wst.xml.xpath2.processor.DynamicError
        public override ResultSequence evaluate(ICollection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec)
        {
            Debug.Assert(args.Count >= min_arity() && args.Count <= max_arity());

            return(fs_times(args));
        }
Exemplo n.º 10
0
        /// <summary>
        /// Evaluate arguments.
        /// </summary>
        /// <param name="args">
        ///            argument expressions. </param>
        /// <exception cref="DynamicError">
        ///             Dynamic error. </exception>
        /// <returns> Result of evaluation. </returns>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public org.eclipse.wst.xml.xpath2.api.ResultSequence evaluate(java.util.Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws org.eclipse.wst.xml.xpath2.processor.DynamicError
        public override ResultSequence evaluate(ICollection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec)
        {
            return(years_from_duration(args));
        }
Exemplo n.º 11
0
        /// <summary>
        /// Evaluate arguments.
        /// </summary>
        /// <param name="args">
        ///            argument expressions. </param>
        /// <exception cref="DynamicError">
        ///             Dynamic error. </exception>
        /// <returns> Result of evaluation. </returns>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public org.eclipse.wst.xml.xpath2.api.ResultSequence evaluate(java.util.Collection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec) throws org.eclipse.wst.xml.xpath2.processor.DynamicError
        public override ResultSequence evaluate(ICollection args, org.eclipse.wst.xml.xpath2.api.EvaluationContext ec)
        {
            return(substring_after(args));
        }