XML Generator component. This requires Python 3 to be installed.
Requires two data feeds. The top input port is the data to be processed. The bottom input port takes a control "script" that describes the output required.
The control feed is a table consisting of 3 columns:
option | key | value
The option - key pairs are as follows:
header - Root - name of the root element
This is the name to be given to used for the root element of the xml
header - Row - name of the primary "record/row" element
This is the element name to be used for each record/row generated
tag - <tagname> - <Table Column Name>
This is the internal "tag name" that you will use to refer to a
given tag. Normally it will be the same as the table column,
but it doesn't have to be.
tag_type - <tagname> - <type of tag>
This is the type of xml item to be generated for the given
tagname and is one of the following: group, element, attribute,
comment.
An element may itself be a group, but differs from a group in that
the group does not have any value of its own. The distinction
between group and element is therefore minor.
parent - <tagname> - <parent-tagname>
This indiciates that the given element identified by tagname is
directly subordinate to the element identified as parent-tagname
and will therefore be containined within it. Elements will be
generated on the XML output in the order in which they appear in
the "parent" commands.
display - tagname - display-name
This identifies what the actual element name to be output
for a given tagname will be. It allows you to specify a
different name to the table column name. By default, the
element name will be the tagname defined here, if no
display command is specified.
breakonchange - <tagname> - <breaktagname>
For a group tag outputting repeated data, if breakonchange
is specified, the repeated data is output within the group
without repeating all other items from the input table.
Only when the value of the tag specified by <breaktagname>
has changed does the next row get output.
ifblank - <tagname> - <value>
The value to be output if the data for the specified
tag is blank.
ifzero - <tagname> - <value>
The value to be output if the data for the specified
tag is zero
ifmissing - <tagname> - <value>
The value to be output if the data for the specified
tag is missing
literal - <tagname> - <value>
Specify a literal value to be output instead of a column
name. The value may optionally include other tags inside
{ } in which case the term literal is a slight misnomer as
the value output will be dynamic. It may then contain the
output of one or more other tags. A literal can therefore be
formed of a number of other tags.
comment - <tagname> - <value>
Specify a comment value to be output The output will
be inside comment <!- -> tags in the generated xml.
The value may optionally include other tags inside
{ } in which case the value output will be dynamic.
It may then contain the output of one or more other tags.
Where a comment declaration is used, there should also
be a tag_type declaration defining this tag as a comment
tag. A comment declaration where there is no corresponding
comment tag_type will have no effect and will be ignored.
numeric - <tagname> - Y
Explicitly states that the given tag is to be treated
as numeric.
integer - <tagname> - Y
Explicitly states that the given tag is to be treated
as integer.
hideifmissing - <tagname> - Y
States that the tag is not to be output if the data
value is missing, and in the case of group elements
that no subordinate elements have been output
hideifblank - <tagname> - Y
States that the tag is not to be output if the data
value is blank, and in the case of group elements
that no subordinate elements have been output
NOTE THAT THIS IS VERY MUCH BETA (PROTOTYPE)
- FEEL FREE TO USE [AT YOUR OWN RISK] - BUT FEEDBACK WELCOME
@takbb Brian Bates May 7th 2021
---
updated: 2022-11-09 - handle missing data
2022-11-09-rev2 - additional output port returning xml as individual string rows
- Type: TableData TableThe input data to be convereted to XML
- Type: TableXML Control TableThe control details that will be used to generate the XML