XML - Validate

Declaration

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

See Also

XML - Create Node | XML - Create Session | XML - Dataset to XML | XML - Delete Node | XML - Edit Node | XML - End Session | XML - Evaluate Xpath | XML - Export | XML - Import | XML - Node to Dataset | XML - Read Node | XML - Save | XML - Sign | XML - Transform | XML - Verify

Validate XML File

Declaration

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

See Also

Create XML Node | Dataset to XML | Delete XML Node | Edit XML Node | End XML Session | Evaluate Xpath Expression | Extract XML Fragment | Merge XML Files | Output XML | Read XML Node | Sign XML Document | Start XML Session | Transform XML | Validate XML File | Verify XML Document | XML Node to Dataset

Description

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

IMPORTANT: AutoMate's XML actions require a basic understanding of XML and related terms, such as XPath, DTD and XSLT.

Practical Usage

See description.

Parameters

General Properties

Property

Type

Req'd

Default

Markup

Description

Validation Type

Text (options)

Yes

Key Container

VALIDATIONTYPE="Schema"

The type of validation in which the in-memory xml document should pass through. The available options are:

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

  • Schema - Choose this option to activate the schema (.xsd) file(s) option.

  • DTD - Choose this option to activate DTD validation.

Schema Files

Text

Yes

(Empty)

<Schema FileName=

"C:\Schema\database.xsd"

Specifies the schema files to validate in-memory XML document against. This parameter is available only if the Validation Type parameter is set to Schema.

Click the Add button to add a new schema file to the list which the in memory xml file will be validated against .

Click the Remove button to remove a schema file from the list.

Session Name

Text

No

(Empty)

SESSIONNAME="FirstXMLSession"

The session name created by a previous Start XML Session step that this action should identify with. This allows several in-memory XML documents to be active simultaneously within the same task.

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

Additional Notes

XML Levels of Accuracy

An XML document has two levels of accuracy:

  1. 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.

  2. 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

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.

 

Description: Validate that XML file adheres to the specified schema. Sessionname is "Two".

 

<AMXMLVALIDATION VALIDATIONTYPE="SCHEMA" SESSION="Two"><Schema FileName="C:\Tutorials\XML Data\Schema Files\booksSchema.xsd" /></AMXMLVALIDATION>

 

↑ Top of Page