Class XmlSchemaValidation<TInput>
Validate XML code in your incoming data against a XML schema definition. You need to define how the XML string can be read from your data row and the schema definition. Rows with a schema that is not valid are send to the error output..
Inheritance
object
DataFlowSource<TInput>
DataFlowTransformation<TInput, TInput>
XmlSchemaValidation<TInput>
Implements
IDataFlowTransformation<TInput, TInput>
IDataFlowSource<TInput>
IDataFlowDestination<TInput>
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: ETLBox.Xml
Assembly: ETLBox.Xml.dll
Syntax
public class XmlSchemaValidation<TInput> : DataFlowTransformation<TInput, TInput>, ILoggableTask, IDataFlowLogging, IDataFlowTransformation<TInput, TInput>, IDataFlowSource<TInput>, IDataFlowSource, IDataFlowDestination<TInput>, IDataFlowDestination, IDataFlowComponent
Type Parameters
Name | Description |
---|---|
TInput | Type of input data. |
Examples
XmlSchemaValidation<MyXmlRow> schemaValidation = new XmlSchemaValidation<MyXmlRow>();
schemaValidation.XmlSelector = row => row.Xml;
schemaValidation.XmlSchema = xsdMarkup;
source.LinkTo(schemaValidation);
schemaValidation.LinkTo(dest);
schemaValidation.LinkErrorTo(error);
Constructors
XmlSchemaValidation()
Declaration
public XmlSchemaValidation()
Examples
XmlSchemaValidation<MyXmlRow> schemaValidation = new XmlSchemaValidation<MyXmlRow>();
schemaValidation.XmlSelector = row => row.Xml;
schemaValidation.XmlSchema = xsdMarkup;
source.LinkTo(schemaValidation);
schemaValidation.LinkTo(dest);
schemaValidation.LinkErrorTo(error);
XmlSchemaValidation(string, Func<TInput, string>)
Declaration
public XmlSchemaValidation(string xmlSchema, Func<TInput, string> xmlSelector)
Parameters
Type | Name | Description |
---|---|---|
string | xmlSchema | |
System.Func<T, TResult><TInput, string> | xmlSelector |
Examples
XmlSchemaValidation<MyXmlRow> schemaValidation = new XmlSchemaValidation<MyXmlRow>();
schemaValidation.XmlSelector = row => row.Xml;
schemaValidation.XmlSchema = xsdMarkup;
source.LinkTo(schemaValidation);
schemaValidation.LinkTo(dest);
schemaValidation.LinkErrorTo(error);
Properties
SourceBlock
SourceBlock from the underlying TPL.Dataflow which is used as output buffer for the component.
Declaration
public override ISourceBlock<TInput> SourceBlock { get; }
Property Value
Type | Description |
---|---|
ISourceBlock<><TInput> |
Overrides
ETLBox.DataFlow.DataFlowSource<TInput>.SourceBlock
TargetBlock
TargetBlock from the underlying TPL.Dataflow which is used as input buffer for the component.
Declaration
public override ITargetBlock<TInput> TargetBlock { get; }
Property Value
Type | Description |
---|---|
ITargetBlock<><TInput> |
Overrides
ETLBox.DataFlow.DataFlowTransformation<TInput, TInput>.TargetBlock
TaskName
A name to identify the task or component. Every component or task comes with a default name that can be overwritten.
Declaration
public override string TaskName { get; set; }
Property Value
Type | Description |
---|---|
string |
Overrides
XmlSchema
The xml schema that is used for verfication
Declaration
public string XmlSchema { get; set; }
Property Value
Type | Description |
---|---|
string |
XmlSelector
The selector on the object that returns the xml that needs to be verified
Declaration
public Func<TInput, string> XmlSelector { get; set; }
Property Value
Type | Description |
---|---|
System.Func<T, TResult><TInput, string> |
Methods
CheckParameter()
Declaration
protected override void CheckParameter()
Overrides
Examples
XmlSchemaValidation<MyXmlRow> schemaValidation = new XmlSchemaValidation<MyXmlRow>();
schemaValidation.XmlSelector = row => row.Xml;
schemaValidation.XmlSchema = xsdMarkup;
source.LinkTo(schemaValidation);
schemaValidation.LinkTo(dest);
schemaValidation.LinkErrorTo(error);
CleanUpOnFaulted(Exception)
Declaration
protected override void CleanUpOnFaulted(Exception e)
Parameters
Type | Name | Description |
---|---|---|
System.Exception | e |
Overrides
Examples
XmlSchemaValidation<MyXmlRow> schemaValidation = new XmlSchemaValidation<MyXmlRow>();
schemaValidation.XmlSelector = row => row.Xml;
schemaValidation.XmlSchema = xsdMarkup;
source.LinkTo(schemaValidation);
schemaValidation.LinkTo(dest);
schemaValidation.LinkErrorTo(error);
CleanUpOnSuccess()
Declaration
protected override void CleanUpOnSuccess()
Overrides
Examples
XmlSchemaValidation<MyXmlRow> schemaValidation = new XmlSchemaValidation<MyXmlRow>();
schemaValidation.XmlSelector = row => row.Xml;
schemaValidation.XmlSchema = xsdMarkup;
source.LinkTo(schemaValidation);
schemaValidation.LinkTo(dest);
schemaValidation.LinkErrorTo(error);
InitComponent()
Declaration
protected override void InitComponent()
Overrides
Examples
XmlSchemaValidation<MyXmlRow> schemaValidation = new XmlSchemaValidation<MyXmlRow>();
schemaValidation.XmlSelector = row => row.Xml;
schemaValidation.XmlSchema = xsdMarkup;
source.LinkTo(schemaValidation);
schemaValidation.LinkTo(dest);
schemaValidation.LinkErrorTo(error);
LinkErrorTo(IDataFlowDestination<ETLBoxError>)
Declaration
public override IDataFlowSource<ETLBoxError> LinkErrorTo(IDataFlowDestination<ETLBoxError> target)
Parameters
Type | Name | Description |
---|---|---|
IDataFlowDestination<ETLBoxError> | target |
Returns
Type | Description |
---|---|
IDataFlowSource<ETLBoxError> |
Overrides
ETLBox.DataFlow.DataFlowSource<TInput>.LinkErrorTo(ETLBox.IDataFlowDestination<ETLBox.ETLBoxError>)
Examples
XmlSchemaValidation<MyXmlRow> schemaValidation = new XmlSchemaValidation<MyXmlRow>();
schemaValidation.XmlSelector = row => row.Xml;
schemaValidation.XmlSchema = xsdMarkup;
source.LinkTo(schemaValidation);
schemaValidation.LinkTo(dest);
schemaValidation.LinkErrorTo(error);