Exemple #1
0
        /*
         * Check if a string satisfies the constraints of NCName data type.
         */
        protected internal virtual bool isConstraintSatisfied(string strValue)
        {
            bool isValidNCName = true;

            if (!XMLChar.isValidNCName(strValue))
            {
                isValidNCName = false;
            }

            return(isValidNCName);
        }         // isConstraintSatisfied
Exemple #2
0
        /// <summary>
        /// Creates a new ResultSequence consisting of the extractable Name within
        /// the supplied ResultSequence
        /// </summary>
        /// <param name="arg">
        ///            The ResultSequence from which to extract the Name </param>
        /// <returns> New ResultSequence consisting of the Name supplied </returns>
        /// <exception cref="DynamicError"> </exception>
//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);
            }

            AnyAtomicType aat      = (AnyAtomicType)arg.first();
            string        strValue = aat.StringValue;

            if (!XMLChar.isValidName(strValue))
            {
                // invalid input
                DynamicError.throw_type_error();
            }

            return(new XSName(strValue));
        }