Icon

KNIME_​Demo Simple XML Generator -DEMO3

KNIME_Demo Simple XML Generator DEMO 3
XML Generator Demo 3- Read a CSV and output xmlwith manual editing of the control table to specify therequired outputREQUIRES PYTHON 3 to be installed in your KNIMEenvironment The "advanced" XML generation is performed by XML Generator being controlled by the MANUALLY EDITED controltable, supplied by Table CreatorIf you set your Python Console Logging level to INFO, you will see a progress message every 1000 rows logged by theXML Generator.File-Preferences-> KNIME-> KNIME GUI -> Console View Log Level (o)INFO The XML Writer is supplied an output folder, andthat's pretty much it. It creates the file namebased on the RowID of the input data. Things have moved on somewhat sincepublishing this workflow.I've updated the XML Generatorcomponent to use the new version ofthis component, but there is a whole lotmore besides and this workflow hardlytouch the surface! The upper output port on XML Generator is the data in singleXML format, declared as KNIME XML data typeThe lower middle port is the same data but in multiple rows,as KNIME String data type. The lower port does not containreference to the ROOT xml node, as it represents onlyindividual rowsThe bottom port is a String table of individual lines of the XML -provided for flexibility in further manipulation or writing of thexml UPDATED: November 2022 with newcomponents This is just my quick way to providelocal file name variables that work withboth old and new file read/write components"born_outside_US.csv"Replace withyour data, and see if this willcontinue to work with no config changesrequired for basic table/row xml output...(That's the aim!)Manually EditedControl table originally createdby the Create XML Generator Control Table componentFirst 3 cols areoption, key, valueRemaining cols are ignored by generatorSort by native-countryUseful for debuggingThe upper port simply passes through thecontrol table.The lower port "visualises" the structure of thecontrol table simply forvisual inspection anddebugging purposesThis isn't always necessarybut I recommend youalways add it anywayGenerates XML from source tablebased on supplied control tableConfig for this node is simply the name of the output file(without the .xml extension). This is the name that will beused by the XML WriterZero config default:output_xmlWrite using pretty printngOr write using CSV Writerwithout pretty printingTurn off Write-headerTurn off Write Quotes (advanced tab)View workflow datafolder in explorer Local FileName Variables CSV Reader Table Creator Sorter XML ControlTable Renderer XML Control Table- Finalizer XML Generator XML Writer CSV Writer Open File or Folder XML Generator Demo 3- Read a CSV and output xmlwith manual editing of the control table to specify therequired outputREQUIRES PYTHON 3 to be installed in your KNIMEenvironment The "advanced" XML generation is performed by XML Generator being controlled by the MANUALLY EDITED controltable, supplied by Table CreatorIf you set your Python Console Logging level to INFO, you will see a progress message every 1000 rows logged by theXML Generator.File-Preferences-> KNIME-> KNIME GUI -> Console View Log Level (o)INFO The XML Writer is supplied an output folder, andthat's pretty much it. It creates the file namebased on the RowID of the input data. Things have moved on somewhat sincepublishing this workflow.I've updated the XML Generatorcomponent to use the new version ofthis component, but there is a whole lotmore besides and this workflow hardlytouch the surface! The upper output port on XML Generator is the data in singleXML format, declared as KNIME XML data typeThe lower middle port is the same data but in multiple rows,as KNIME String data type. The lower port does not containreference to the ROOT xml node, as it represents onlyindividual rowsThe bottom port is a String table of individual lines of the XML -provided for flexibility in further manipulation or writing of thexml UPDATED: November 2022 with newcomponents This is just my quick way to providelocal file name variables that work withboth old and new file read/write components"born_outside_US.csv"Replace withyour data, and see if this willcontinue to work with no config changesrequired for basic table/row xml output...(That's the aim!)Manually EditedControl table originally createdby the Create XML Generator Control Table componentFirst 3 cols areoption, key, valueRemaining cols are ignored by generatorSort by native-countryUseful for debuggingThe upper port simply passes through thecontrol table.The lower port "visualises" the structure of thecontrol table simply forvisual inspection anddebugging purposesThis isn't always necessarybut I recommend youalways add it anywayGenerates XML from source tablebased on supplied control tableConfig for this node is simply the name of the output file(without the .xml extension). This is the name that will beused by the XML WriterZero config default:output_xmlWrite using pretty printngOr write using CSV Writerwithout pretty printingTurn off Write-headerTurn off Write Quotes (advanced tab)View workflow datafolder in explorerLocal FileName Variables CSV Reader Table Creator Sorter XML ControlTable Renderer XML Control Table- Finalizer XML Generator XML Writer CSV Writer Open File or Folder

Nodes

Extensions

Links