Skip to main content

xSuite Interface Windows Prism 5.x – Online Help

Output Format "Xml"

This output format generates an XML file from the index data of the document. The file attachments of the document can be embedded, or references to file attachments to be carried externally can be generated.

Property

Description

OutputFormat[].AttachFileMode

Mode determining how additional file attachments are added to the XML file:

  • None: no attachments (default value)

  • Reference: as a file reference in the XML file

  • Embedded: BASE64-coded binary data, embedded in the XML file

The physical availability of the files in the file system that are referenced in the Reference mode is not part of this output format creation. They must be made available differently (e.g., via a file-based output system such as "File") (see also comparable example for the"InternalJson" output format).

OutputFormat[].FieldNode

By default, when successively building the XML file, nodes of the same path are generated only once. Only subnodes that do not yet exist are created anew.

However, if all header data output fields are to be output under the same, repeating node name, define the path of this node to be generated multiple times here. In OutputFormat[].Field[].OutputName, only specify the relative sub-paths to this node. If there are to be no sub-paths, the .OutputName can have an empty value.

OutputFormat[].ItemNode[]

Subparameters for defining repeating eponymous nodes to be set up, each representing a row of tabular data

The operation is analogous to the .FieldNode property above.

  1. ItemNode*: the node in XPath syntax

  2. FieldName: table name of the source fields in the field catalog (optional)

The ItemNode property can be defined multiple times with different FieldName parameters if there are multiple XML nodes with table data to which values from different source tables are to be assigned. If the parameter is omitted, the entry will apply globally to all tables.

In the field mappings under .OutputName, specify the path to the target node to be generated. Define this path relative to the node specified in the ItemNode parameter for tabular data.

OutputFormat[].ItemFieldNode[]

Subparameters for defining the table fields to be created repeatedly with the same name below a table row node .ItemNode[]

The operation is analogous to the FieldNode property above, but here it refers to tabular fields rather than header data fields:

  1. FieldNode*: node in question, in XPath syntax

  2. FieldName: table name of the source fields in the field catalog (optional)

The .ItemFieldNode[] property can be defined multiple times with different FieldName parameters if there are multiple XML nodes with table data to which values from different source tables are to be assigned. If the parameter is omitted, the entry will apply globally to all tables.

Specify the FieldNode parameter relative to the parent table row node .ItemNode[]. In the .Outputname of the field mappings, only configure the relative paths related to the FieldNode parameter.

OutputFormat[].AttachFileNode(*)

Definition of XML nodes in XPath syntax under which the reference to file attachments or the binary data of file attachments are output

This definition is required in the Reference and Embedded modes.

  1. File*: full path to the (parent) node for the reference/binary data output

  2. Data: relative path for the reference/binary data (optional)

  3. Name: relative path for the additional output of the file name (optional)

  4. Type: path for the additional output of the MIME type (optional)

The path defined in the File parameter is generated multiple times for the lowest node, if necessary, if there is more than one file attachment to be output. The Data, Name, and Type parameters require relative paths with respect to the path specified in the File parameter. The Data parameter serves to write the primary output value (file reference or binary data) alternatively to a subnode instead of directly to File. If supplementary metadata is necessary for a file attachment, the Name and Type parameters serve to provide this.

OutputFormat[].AttachFileRefMacro

Macro expression for formatting the file reference value in Reference mode (optional)

The default value is preset with the expression "%FileName%" (i.e., only the pure file name will be output).

The following example shows an extract of a configuration and the resulting structure of the XML data. The XPath expressions for the nodes to be generated are of primary interest.

Notice

XPath represents a syntax for querying XML content, which has been adapted here in a rudimentary manner so that XML files can also be created with a similar notation. The only syntax elements that are supported are simple path specifications with nodes and attributes. The use of namespaces is not supported.

{
   "OutputFormat": [
      {
         "ItemNode": [
            "ItemNode: /Document/Item"
         ],
         "AttachFileNode": "File: /Document/File, Name: @name"
         "Field": [
            {
               "Name": "Field1",
               "OutputName": "/Document/Field[@name='Field1']"
            },{
               "Name": "Items.Field1",
               "OutputName": "Field[@name='ItemsField1']"
            }
         ]
      }
   ]
}

The following XML data is generated from this configuration:

<Document>
   <Field name="Field1">…</Field>
   <Item>
      <Field name="ItemsField1">…</Field>
   </Item>
   <File name="…">…</File>
</Document>

The configuration is somewhat more complex if the field name is not to be output in the same node as its value, but in a parallel node:

<Field>
   <Name>Field1</Name>
   <Value>…</Value>
</Field>

This variant is supported only in combination with a set .FieldNode (or .ItemFieldNode[] for tables). To also define the name node and value, use the following subparameters for the .OutputName:

  1. ValueNode*: relative path of the node to output the field value in XPath syntax

  2. ValueNode: relative path of the node to output the field name in XPath syntax

  3. Name: field name to be output

The properties from the example above are thus to be added or changed as follows:

{
   "OutputFormat": [
      {
         "FieldNode": "/Document/Field",
         "ItemFieldNode": [
            "FieldNode: Field"
         ],
         "Field": [
            {
               "Name": "Field1",
               "OutputName": "ValueNode: Value, NameNode: Name, Name: Field1"
            },{
               "Name": "Items.Field1",
               "OutputName": "ValueNode: Value, NameNode: Name, Name: ItemsField1"
            }
         ]
      }
   ]
}