示例#1
0
        /// <summary>
        /// Creation of a result sequence consisting of a URI from a previous result
        /// sequence.
        /// </summary>
        /// <param name="arg">
        ///            previous result sequence </param>
        /// <exception cref="DynamicError"> </exception>
        /// <returns> new result sequence consisting of the URI supplied </returns>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public org.eclipse.wst.xml.xpath2.api.ResultSequence constructor(org.eclipse.wst.xml.xpath2.api.ResultSequence arg) throws org.eclipse.wst.xml.xpath2.processor.DynamicError
        public override ResultSequence constructor(ResultSequence arg)
        {
            if (arg.empty())
            {
                return(ResultBuffer.EMPTY);
            }

            AnyType aat = (AnyType)arg.first();

            if (!(aat.string_type().Equals("xs:string") || aat.string_type().Equals(XS_ANY_URI) || aat.string_type().Equals("xs:untypedAtomic")))
            {
                throw DynamicError.invalidType();
            }

            return(new XSAnyURI(aat.string_value()));
        }
示例#2
0
        /// <summary>
        /// Equality comparison between this and the supplied representation which
        /// must be of type xs:anyURI (or, by promotion of this, xs:string)
        /// </summary>
        /// <param name="arg">
        ///            The representation to compare with </param>
        /// <returns> True if the two representation are of the same String. False
        ///         otherwise </returns>
        /// <exception cref="DynamicError"> </exception>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public boolean eq(AnyType arg, org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext) throws org.eclipse.wst.xml.xpath2.processor.DynamicError
        public virtual bool eq(AnyType arg, DynamicContext dynamicContext)
        {
            if (arg is XSAnyURI || arg is XSString)
            {
                if (this.string_value().Equals(arg.string_value()))
                {
                    return(true);
                }
            }
            else
            {
                throw DynamicError.throw_type_error();
            }

            return(false);
        }
示例#3
0
        /// <summary>
        /// Less than comparison between this and the supplied representation which
        /// must be of type xs:anyURI (or, by promotion of this, xs:string)
        ///
        /// @since 1.1
        /// </summary>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public boolean lt(AnyType arg, org.eclipse.wst.xml.xpath2.api.DynamicContext context) throws org.eclipse.wst.xml.xpath2.processor.DynamicError
        public virtual bool lt(AnyType arg, DynamicContext context)
        {
            if (!(arg is XSAnyURI || arg is XSString))
            {
                throw DynamicError.throw_type_error();
            }

            string anyURI       = this.string_value();
            string compareToURI = arg.string_value();

            if (anyURI.CompareTo(compareToURI) < 0)
            {
                return(true);
            }

            return(false);
        }