Validate XML File Action

Declaration

<AMXMLVALIDATION VALIDATIONTYPE="text [options]"><Schema FileName="text" /></AMXMLVALIDATION>

See Also

Sign XML File Action, Output XML File Action, Verify XML File Action

Description

Validates that an XML file in session is well-formed, schema compliant or DTD compliant.

Practical Usage

See description.

Parameters

General Tab

Validation Type

Text [options], Optional - Default "Well formed"
MARKUP:VALIDATIONTYPE="Schema"

Allows you to specify the type of validation you want the in-memory xml document to pass through.

The available options are:

Well-Formed-- Specifies that the XML file conforms to the rules that govern a well-formed document. (Default)

Schema--Choose this option to activate the Schema Files option.

DTD--Choose this option to activate the DTD validation.

Note: An XML document can have one of two levels of accuracy:

Well-formed. A well-formed document conforms to all of XML's syntax rules. For example, if an element has an opening tag with no closing tag and is not self-closing, it is not well-formed. A document that is not well-formed is not considered to be XML and a conforming parser is not allowed to process it.

Valid. A valid document additionally conforms to some semantic rules. These rules are either user-defined, or included as an XML schema or DTD. For example, if a document contains an undefined tag, then it is not valid; a validating parser is not allowed to process it

Well-Formed

Specifies that the XML file conforms to the rules that govern a well-formed document.

Schema

Text, Required
MARKUP: <Schema FileName="C:\NA\XML\XML Example\Schema\cd-database.xsd" />

Specifies the schema files to validate in-memory XML document against. Available only when Validation Type combo box is set to Schema.

Add

Allows to add new schema file to the list against which in memory xml file will be validated.

Remove

Allows to remove schema file from the list.

DTD

Specifies that the XML file is a DTD file.

Session Name

Text, Optional - Default "XMLSession1"
MARKUP: SESSIONNAME="FirstXMLSession"

Specifies the session name to run the XML file in subsequent XML steps. This allows several connections to be active simultaneously.

Notes

Custom Description

This action includes the Description tab for entering a custom step description.

More on setting custom step description

Standard Error Handling Options

This action also includes the standard Error Causes and On Error failure handling options/tabs.

More on Error Handling Options

Variables and Expressions

All text fields allow the use of expressions, which can be entered by surrounding the expression in percentage signs (example: %MYVARIABLE%, %Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by pressing F2.

More on variables
More on expressions

More on the expression builder

Example

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

<AMXMLVALIDATION VALIDATIONTYPE="DTD" />

<AMXMLVALIDATION />