The XML I/O commands allow you to read and write XML data. There is only one choice for reading XML data. There are two choices for writing XML data. For simple records, you can use one inclusive command that includes writing the start-of-record tag, the data, and the end-of-record tag. However, for more complex records that include nested data, you need to use two separate commands. The first command writes the start-of-record tag and the data; the second command writes the end-of-record tag. In addition, there is a special write XML command that allows you to write processing instructions, doctypes, comments, etc. (for example, the preamble)
The I/O command can be:
Write XML – Writes XML-coded data (including both the start-of-record tag and the end-of-record tag).
Write XML w/ No End Record Tag – Writes XML-coded data without an end-of-record tag.
Write XML End Record Tag Only – Writes only the XML end-of-record tag.
Write XML Text – Writes XML processing instructions, doctypes, comments, etc.
Read XML – Reads XML-coded data.
Application Directory – the name of the directory containing XML data to be read or the directory to which XML data will be written. Select the up arrow next to the Application Directory text box, and the Directories (Mailboxes) window displays. Navigate down into the records in the directory and double-click the record containing XML data. The program automatically populates the Application Directory, Application File, and File Record text boxes.
Application File – the name of the file containing the XML data to be read or to which the XML data will be written.
File Record – the name of the record containing the XML data to be read or to which the XML data will be written
For the Write XML Text rule command, the window displays as shown below:
XML designates the location (directory/file) to which XML processing instructions, doctypes, comments, etc. will be written. This is the same directory and file that you entered for the other Write XML rule commands. Select the up arrow after the XML text box, and you have two choices:
If you choose Memory Variable, the Memory Variables window displays. Either double-click the memory variable in which the location (directory/file) is stored or drag it from the Memory Variable window and drop it on the XML text box. The caption over the text box changes to XML – Memory Variable.
If you choose Select File and Location, the Directories (Mailboxes) window displays. Drill down into the directory that contains the file to which the XML data will be written. Either double-click the file or drag it from the Directories (Mailboxes) window and drop it on the XML text box. The caption over the text box changes to XML – Directory / File.
XML Text contains the actual XML processing instructions, doctypes, comments, etc. Select the up arrow after the XML Text text box, and you have the following three choices:
If you choose Memory Variable, the Memory Variable window displays. Either double-click the memory variable containing XML text or drag it from the Memory Variable window and drop it on the XML Text text box. The caption over the text box on the Rule Command window changes to XML Text – Memory Variable.
If you choose Record/Field, the Records/Tables window displays. Drill down into the record that contains the field in which the XML text is stored. Either double-click the field containing XML text or drag it from the Records/Tables window and drop it on the XML Text text box. The caption over the text box on the Rule Command window changes to XML Text – Record / Field Variable.
If you choose Constant, the Constant Value window displays. Enter the XML text in the text box on the Constant Value window and select OK. The caption over the text box on the Rule Command window changes to XML Text – Constant.