This statement has the following parameters:
Parameter | Description |
---|---|
DocumentPointer | Identifier of a COBOL pointer data item that points to an XML document stored in memory as a text string. |
DocumentLength | Numeric literal or identifier of a COBOL numeric data item that specifies the length of the XML document stored in memory as a text string. |
SchemaName | Numeric literal or identifier of a COBOL alphanumeric data item that specifies the filename of the schema file to be used to validate the XML document specified by DocumentPointer and DocumentLength. 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. |
The XML VALIDATE TEXT statement tests the XML document specified by the DocumentPointer and DocumentLength parameters 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 block of memory is allocated to hold the XML document whilst it is validated. The COBOL application is responsible for releasing this memory when it is no longer needed by using XML FREE TEXT.
A status value is returned in the data item XML-Status of XML-data-group , which is defined in the copy file lixmldef.cpy.
XML VALIDATE TEXT MY-DOCUMENT-POINTER MY-DOCUMENT-LENGTH "MY-SCHEMA". IF NOT XML-OK GO TO Z.