Esempio n. 1
0
        /// <summary>
        /// Validates an XML document with the current validator settings.
        /// The process can stop at the first assertion or validate the whole
        /// document.
        /// </summary>
        /// <remarks>This method is NOT thread-safe.</remarks>
        /// <param name="xDocument">An instance of an XML document to be validated.
        /// Must not be null.
        /// It is recommended to supply a document with line information
        /// for better diagnostics.</param>
        /// <param name="fullValidation">Indicates whether to validate the
        /// whole document regardless of any assertion, or to stop validation at
        /// the first assertion.
        /// </param>
        /// <returns>Detailed validation results.</returns>
        /// <exception cref="ArgumentNullException">If xDocument is null.</exception>
        public ValidatorResults Validate(XDocument xDocument, bool fullValidation)
        {
            if (xDocument == null)
            {
                throw new ArgumentNullException("xDocument - XML document instance");
            }
            ValidationEvaluator evaluator = new ValidationEvaluator(this.schema, xDocument, fullValidation);

            return(evaluator.Evaluate());
        }
Esempio n. 2
0
 /// <summary>
 /// Validates an XML document with the current validator settings.
 /// The process can stop at the first assertion or validate the whole
 /// document.
 /// </summary>
 /// <remarks>This method is NOT thread-safe.</remarks>
 /// <param name="xDocument">An instance of an XML document to be validated.
 /// Must not be null.
 /// It is recommended to supply a document with line information
 /// for better diagnostics.</param>
 /// <param name="fullValidation">Indicates whether to validate the
 /// whole document regardless of any assertion, or to stop validation at
 /// the first assertion.
 /// </param>
 /// <returns>Detailed validation results.</returns>
 /// <exception cref="ArgumentNullException">If xDocument is null.</exception>
 public ValidatorResults Validate(XDocument xDocument, bool fullValidation)
 {
     if (xDocument == null)
     {
         throw new ArgumentNullException("xDocument - XML document instance");
     }
     ValidationEvaluator evaluator = new ValidationEvaluator(this.schema, xDocument, fullValidation);
     return evaluator.Evaluate();
 }