Search

Home

Home

XML Format Editor

XML Format Editor

The XML (Extensible Markup Language) Format Editor allows you to convert a data bus data stream into XML and is available in the following operators in the GRAVITY system:

OUTPUT FILEOUTPUT FILE

OUTPUT FTPOUTPUT FTP

CONVERT BITS TO FORMATCONVERT BITS TO FORMAT

An XML format has to always begin with a main node. The node inserted by default is root.

icon
If the data bus contains more than one record and you want the generated XML file to include all records, you must add a child node under the main node, name it, and then drag the data bus bits under that node. If you place the bits directly under the main node, the XML data will contain only the last record from the data bus.

You build the XML format by dragging and dropping elements from the Busbar area to the XML nodes area. To insert a new node with data from the data bus, drag a data bus bit and drop it where you want it to appear in the structure you’re building. To remove a node from the structure, drag it back to the Busbar area. You can also use the navigation buttons for this purpose.

image

You can also create nested structures by dragging and dropping a Node element from the CONTAINER NODE area into the XML nodes area (drag and drop action) at the position where you want to create them.

image
icon
The operator generates data based on the nesting levels of the nodes. The data for each level is obtained by grouping the data from the data bus according to the bits used at that nesting level and its parent levels. This is a very important feature, as it allows processing of parent–child type data (for example, an order and its items). A data bus carrying “flat” data (where parent data is repeated as many times as there are child records) can thus be interpreted as a hierarchical structure, provided that the corresponding bits are placed at the correct levels.

If you plan to use attributes in your XML format definition, drop the data bus bit onto the field next to the node to which you want to add the attribute. You can define any number of attributes for an element.

image

You can rename a node, element, or attribute in the Element properties area after selecting the desired element in the format editing area.

image