Show / Hide Table of Contents

Class XmlDocumentValidator

A validator class that makes easier to validate XML documents against XML schemas.

Inheritance
System.Object
XmlDocumentValidator
Implements
IValidator<System.Xml.XmlDocument>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Juhta.Net.Validation
Assembly: Juhta.Net.Validation.dll
Syntax
public class XmlDocumentValidator : IValidator<XmlDocument>

Constructors

| Improve this Doc View Source

XmlDocumentValidator()

Initializes a new instance.

Declaration
public XmlDocumentValidator()

Methods

| Improve this Doc View Source

AddSchema(String)

Adds an XML schema to this validator instance.

Declaration
public void AddSchema(string schema)
Parameters
Type Name Description
System.String schema

Specifies an XML schema string.

| Improve this Doc View Source

AddSchema(Uri)

Adds an XML schema to this validator instance.

Declaration
public void AddSchema(Uri schemaUri)
Parameters
Type Name Description
System.Uri schemaUri

Specifies the URI of a schema to be added to the instance.

| Improve this Doc View Source

AddSchema(XmlSchema)

Adds an XML schema to this validator instance.

Declaration
public void AddSchema(XmlSchema schema)
Parameters
Type Name Description
System.Xml.Schema.XmlSchema schema

Specifies an XmlSchema object.

| Improve this Doc View Source

Validate(XmlDocument)

Validates a specified XML document.

Declaration
public void Validate(XmlDocument document)
Parameters
Type Name Description
System.Xml.XmlDocument document

Specifies an System.Xml.XmlDocument object.

Remarks

If the XML document contains validation errors, the method collects the corresponding exceptions to an exception chain of the type System.Xml.Schema.XmlSchemaValidationException. This exception chain will be thrown as an inner exception of ValidationException after the validation process is finished.

| Improve this Doc View Source

Validate(XmlDocument, String)

Validates a specified XML document against a specified XML schema.

Declaration
public static void Validate(XmlDocument document, string schema)
Parameters
Type Name Description
System.Xml.XmlDocument document

Specifies an XmlDocument object.

System.String schema

Specifies an XML schema as a string.

Remarks

If the XML document contains validation errors, the function collects the corresponding exceptions to an exception chain of the type XmlSchemaValidationException. This exception chain will be thrown after the validation process is finished.

| Improve this Doc View Source

Validate(XmlDocument, XmlSchema)

Validates a specified XML document against a specified XML schema.

Declaration
public static void Validate(XmlDocument document, XmlSchema schema)
Parameters
Type Name Description
System.Xml.XmlDocument document

Specifies an XmlDocument object.

System.Xml.Schema.XmlSchema schema

Specifies an XmlSchema object.

Remarks

If the XML document contains validation errors, the function collects the corresponding exceptions to an exception chain of the type XmlSchemaValidationException. This exception chain will be thrown after the validation process is finished.

Implements

IValidator<T>
  • Improve this Doc
  • View Source
Back to top Copyright © 2017-2019 Juha Lähteenmäki
Generated by DocFX