C# Class HandCoded.FpML.Validation.ReferenceRule

The ReferenceRule class validates an intra-document reference recorded using 'ID' and 'IDREF' based attributes. When possible type information is used to locate possible matching elements otherwise element names are used instead.
Inheritance: HandCoded.Validation.Rule
Exibir arquivo Open project: formicary/fpml-toolkit-csharp

Public Methods

Method Description
ReferenceRule ( Precondition precondition, string name, string contextType, string contextElements, string targetType, string targetElements ) : System

Construct a ReferenceRule instance that will locate context and target elements based on the data provided.

ReferenceRule ( Precondition precondition, string name, string contextType, string contextElements, string targetType, string targetElements, string referenceAttribute ) : System

Construct a ReferenceRule instance that will locate context and target elements based on the data provided.

Protected Methods

Method Description
Validate ( NodeIndex nodeIndex, ValidationErrorHandler errorHandler ) : bool

Validates all the elements registered at construction using the NodeIndex to locate them as quickly as possible.

Validate ( XmlNodeList contexts, XmlNodeList targets, ValidationErrorHandler errorHandler ) : bool

Checks the elements in context XmlNodeList to see if they reference elements in the target XmlNodeList.

Method Details

ReferenceRule() public method

Construct a ReferenceRule instance that will locate context and target elements based on the data provided.
public ReferenceRule ( Precondition precondition, string name, string contextType, string contextElements, string targetType, string targetElements ) : System
precondition HandCoded.Validation.Precondition A instance.
name string The unique name for the rule.
contextType string The schema type for the context element.
contextElements string An array of potential context element names.
targetType string The schema type for the target element.
targetElements string An array of potential target element names.
return System

ReferenceRule() public method

Construct a ReferenceRule instance that will locate context and target elements based on the data provided.
public ReferenceRule ( Precondition precondition, string name, string contextType, string contextElements, string targetType, string targetElements, string referenceAttribute ) : System
precondition HandCoded.Validation.Precondition A instance.
name string The unique name for the rule.
contextType string The schema type for the context element.
contextElements string An array of potential context element names.
targetType string The schema type for the target element.
targetElements string An array of potential target element names.
referenceAttribute string The name of the attribute containing the reference.
return System

Validate() protected method

Validates all the elements registered at construction using the NodeIndex to locate them as quickly as possible.
protected Validate ( NodeIndex nodeIndex, ValidationErrorHandler errorHandler ) : bool
nodeIndex HandCoded.Xml.NodeIndex The of the test document.
errorHandler ValidationErrorHandler The used to report issues.
return bool

Validate() protected method

Checks the elements in context XmlNodeList to see if they reference elements in the target XmlNodeList.
protected Validate ( XmlNodeList contexts, XmlNodeList targets, ValidationErrorHandler errorHandler ) : bool
contexts System.Xml.XmlNodeList A of context instances.
targets System.Xml.XmlNodeList A of target instances.
errorHandler ValidationErrorHandler The used to report errors.
return bool