XML VALIDATE FILE

This statement has the following parameters:

Parameter Description
DocumentName A nonnumeric literal or an identifier of an alphanumeric data item, the value of which is the file name of the file containing the XML document to be validated with the schema specified by the SchemaName parameter.
SchemaName A nonnumeric literal or an identifier of an alphanumeric data item, the value of which is the name of a file containing an XML schema that will be used to validate the document specified by the DocumentName parameter.

Description

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

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. The schema file is supplied by the user.

A status value is returned in the XML-data-group data item, which is defined in the copybook, lixmldef.cpy.

Note: In the Windows implementation of XML Extensions, the Microsoft XML parser 4.0 ignores the document type definition (DTD) when validating an XML document against a schema file. Thus, any entities declared in the DTD will not be defined and cannot be referenced. Any XML document that contains entity references, other than the predefined XML entities, must be transformed with an XSLT stylesheet prior to validation against a schema file when using the Microsoft XML parser 4.0 so that any non-predefined entity references are removed. Otherwise, the document will fail validation.

Example

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