XML VALIDATE FILE

This statement has the following parameters:

Parameter Description
DocumentName Nonnumeric literal or identifier of an alphanumeric data item that specifies the filename of the file that specifies the XML document to be validated. If an extension is not specified in the filename, the extension .xml is appended to the specified filename.
SchemaName Nonnumeric literal or identifier of an alphanumeric data item that specifies the filename of the XML schema file to be used to validate the XML document specified by DocumentName. The filename extension is forced to .xsd by replacing any existing extension in the filename or, if no extension is present, the extension .xsd is appended to the specified filename.

Description

The XML VALIDATE FILE statement tests the XML document specified by the DocumentName parameter to see if it is well-formed and valid with respect to the XML schema specified by the SchemaName parameter.

A well-formed XML document is one that conforms to XML syntax rules. A valid XML document is one that is both well-formed and has content that conforms to rules specified by an XML schema file.

A status value is returned in the data item XML-Status of XML-data-group, which is defined in the copy file lixmldef.cpy. A text description of an error, if any, in the validity of the document can be obtained using XML GET STATUS-TEXT.

Example

XML VALIDATE FILE
    "MY-DOCUMENT"
    "MY-SCHEMA".
IF NOT XML-OK GO TO Z.