Show / Hide Table of Contents

Class DdiValidator

Provides methods to validate a DDI 3 XML instance against the DDI 3 schemas.

Inheritance
object
DdiValidator
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: Algenta.Colectica.Model.Ddi.Serialization
Assembly: Algenta.Colectica.Model.Ddi.dll
Syntax
public class DdiValidator
Remarks

This currently validates against the DDI 3.1 schemas. When DDI 3.2 is released, this class will be updated to allow validating against either schema.

Constructors

DdiValidator(string, DdiFileFormat)

Initializes a new instance of the DdiValidator class.

Declaration
public DdiValidator(string fileName, DdiFileFormat fileFormat = DdiFileFormat.Unknown)
Parameters
Type Name Description
string fileName

Name of the file to validate.

DdiFileFormat fileFormat

The format of the file.

Properties

Errors

Gets any errors found during validation.

Declaration
public ReadOnlyCollection<XmlSchemaException> Errors { get; }
Property Value
Type Description
ReadOnlyCollection<XmlSchemaException>

FileFormat

Gets the DDI file format being validated.

Declaration
public DdiFileFormat FileFormat { get; set; }
Property Value
Type Description
DdiFileFormat

FileName

Gets the name of the file to be validated.

Declaration
public string FileName { get; }
Property Value
Type Description
string

The name of the file to be validated.

GeneralErrors

Gets any messages found during validation.

Declaration
public ReadOnlyCollection<Exception> GeneralErrors { get; }
Property Value
Type Description
ReadOnlyCollection<Exception>

ResultMessages

Returns the collected warning and error exceptions as a series of ResultMessages

Declaration
public Collection<ResultMessage> ResultMessages { get; }
Property Value
Type Description
Collection<ResultMessage>

ValidatedXDocument

Gets or sets the validated XML.

Declaration
public XDocument ValidatedXDocument { get; set; }
Property Value
Type Description
XDocument

The validated XML.

ValidatedXml

Gets or sets the validated XML.

Declaration
public XmlDocument ValidatedXml { get; set; }
Property Value
Type Description
XmlDocument

The validated XML.

Warnings

Gets any warnings found during validation.

Declaration
public ReadOnlyCollection<XmlSchemaException> Warnings { get; }
Property Value
Type Description
ReadOnlyCollection<XmlSchemaException>

Methods

GetSchema(DdiFileFormat)

Loads the XML schema set for the specified DDI version and format.

Declaration
public static XmlSchemaSet GetSchema(DdiFileFormat version)
Parameters
Type Name Description
DdiFileFormat version
Returns
Type Description
XmlSchemaSet

Validate()

Validates the DDI file.

Declaration
public bool Validate()
Returns
Type Description
bool

true if validation was successful; otherwise false.

In this article
Back to top Generated by DocFX