This the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

XML File Output

This connection type writes an XML file whenever a parameter value changes. It uses a configurable XML template with placeholders that are replaced with the current parameter values each time the file is written.

Configuration

  • Filename: The path and name of the XML file to be written. You can use the Browse button to select or create a file.
  • Template: An XML document that serves as the template for the output file. Any occurrence of $VariableName in the template — both in text content and in attribute values — will be replaced with the current value of the corresponding parameter before the file is written.

The template must be a valid XML document. BTConnect will validate it on startup and report an error if it cannot be parsed.

Variables

Variables are defined implicitly by the placeholders in the template. Any $Name pattern (where Name consists of letters and digits) found in the template becomes a write-only parameter.

For example, a template like:

<?xml version="1.0" encoding="UTF-8"?>
<status source="$Source">
  <state>$State</state>
  <level>$Level</level>
</status>

will create parameters Source, State, and Level.

Each time any of these parameters is set, all placeholders in the template are replaced with the current values and the resulting XML is saved to the configured file.

Parameters

The parameters are derived from the $Name placeholders found in the template. For each unique placeholder name, one parameter is created:

  • <Name> (string, write-only) - Setting this parameter replaces all occurrences of $Name in the template and rewrites the output file.