Hub
Pricing About
ComponentComponent

XML Generator

takbb profile image
Draft Latest edits on 
May 9, 2021 2:38 PM
Drag & drop
Like
Use or download
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

Component details

Input ports
  1. Type: Table
    Data Table
    The input data to be convereted to XML
  2. Type: Table
    XML Control Table
    The control details that will be used to generate the XML
Output ports
  1. Type: Table
    XML Out
    The generated xml
  2. Type: Table
    String Out
    The generated row-by-row xml in String format, without the xml header or root element

Used extensions & nodes

Created with KNIME Analytics Platform version 4.3.2
  • Go to item
    KNIME Base nodesTrusted extension

    KNIME AG, Zurich, Switzerland

    Version 4.3.2

    knime
  • Go to item
    KNIME Python Integration

    KNIME AG, Zurich, Switzerland

    Version 4.3.2

    knime
  • Go to item
    KNIME Quick FormsTrusted extension

    KNIME AG, Zurich, Switzerland

    Version 4.3.2

    knime
  • Go to item
    KNIME XML-ProcessingTrusted extension

    KNIME AG, Zurich, Switzerland

    Version 4.3.0

    knime

This component does not have nodes, extensions, nested components and related workflows

Legal

By using or downloading the component, you agree to our terms and conditions.

KNIME
Open for Innovation

KNIME AG
Talacker 50
8001 Zurich, Switzerland
  • Software
  • Getting started
  • Documentation
  • Courses + Certification
  • Solutions
  • KNIME Hub
  • KNIME Forum
  • Blog
  • Events
  • Partner
  • Developers
  • KNIME Home
  • Careers
  • Contact us
Download KNIME Analytics Platform Read more about KNIME Business Hub
© 2025 KNIME AG. All rights reserved.
  • Trademarks
  • Imprint
  • Privacy
  • Terms & Conditions
  • Data Processing Agreement
  • Credits