XML RESOLVE SCHEMA-FILE

This statement has the following parameters:

Parameter Description
SchemaFileName An identifier of an alphanumeric data item, the value of which is the schema filename to be resolved. The resolved schema filename is stored in this same data item upon successful completion of the statement.

Description

The XML RESOLVE SCHEMA-FILE statement is used to resolve the name of an XML schema file specified for the SchemaFileName parameter. The resolution process is similar to that for the ModelFileName#DataName parameter of an XML IMPORT FILE, XML IMPORT TEXT, XML EXPORT FILE, or XML EXPORT TEXT statement. The value of this parameter must specify an existing schema file.

XML Extensions uses the schema files only as input files. When XML Extensions references a schema file, the appropriate predetermined extension is added, regardless of the presence or lack of an extension on the schema file parameter supplied by the COBOL program.

XML Extensions uses the CBL_LOCATE_FILE library routine to locate a schema file (with the appropriate extension added) except when:

  • the schema filename contains a directory separator character (such as "\" on Windows);
  • the file exists; or
  • the filename is a URL (that is, the name begins with "http://", https://, or "file://"). If the name is a URL, it is used "as is". Otherwise, the file extension is forced to be .xsd.

Example

XML RESOLVE SCHEMA-NAME 
       MY-SCHEMA-FILE. 
IF NOT XML-OK GO TO Z.