Versioning of XML documents

Common SQL API stored procedures support multiple versions of the three XML parameter documents: XML input documents, XML output documents, and XML message documents.

If the structure, attributes, or types in an XML parameter document change, the version of the XML parameter document changes. Therefore, the content of an XML parameter document varies depending on the version that you specify.

The version of all three of these documents remains in sync when you call a stored procedure. For example, if you call the GET_SYSTEM_INFO stored procedure and specify the major_version parameter as 1 and the minor_version parameter as 1, the XML input, XML output, and XML message documents will be Version 1.1 documents.

Version information in an XML parameter document is expressed as key and value pairs for Document Type Major Version and Document Type Minor Version. For example, an XML output document might define the following keys and values in a dictionary element:
   <key>Document Type Name</key><string>Data Server Configuration Output</string>
   <key>Document Type Major Version</key><integer>2</integer>
   <key>Document Type Minor Version</key><integer>0</integer>

To determine the highest supported document version for a stored procedure, specify NULL for the major_version parameter, the minor_version parameter, and all other required parameters. The stored procedure returns the highest supported document version as values in the major_version and minor_version output parameters, and sets the xml_output and xml_message output parameters to NULL.

If you specify non-null values for the major_version and minor_version parameters, you must specify a document version that is supported . If the version is invalid, the stored procedure returns an error (-20457).

If the XML input document in the xml_input parameter specifies the Document Type Major Version and Document Type Minor Version keys, the value for those keys must be equal to the values that you specified in the major_version and minor_version parameters, or an error (+20458) is raised.