Icon

KNIME_​Demo Simple XML Generator -DEMO2

KNIME_Demo Simple XML Generator DEMO 2
XML Generator Demo 2- Read a CSV and output xmlwith manual editing of the control table to specify therequired outputREQUIRES PYTHON 3 to be installed in your KNIMEenvironment For demo purposes, launch the output filein the associated xml app in your environment.Remove this node if you have no associatedapp, or you don't wish to launch it. The "advanced" XML generation is performed by XML Generator being controlled by the MANUALLY EDITED control table, supplied by Table CreatorIf you set your Python Console Logging level to INFO, you will see a progress message every 1000 rows logged by the XML 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. "Local File Name Variables" components allow meto quickly provide a file name relative to theworkflow's data folder, or a link to the data folderitself. It then creates variables of type String, Pathand URL so there is a variable suitable for bothlegacy (deprecated) and newer file componentswithout me having to care! The upper output port on XML Generator is the data in singleXML format, declared as KNIME XML data typeThe lower output 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 rows 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!)Generates 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_xmlThe control table generated in demo1 has now been manuallycopied/pasted into Table Creator whereupon it can be edited.I am too lazy to rename the columns in Table Creator soI used by "Rename Table Creator Columns" componentto receive the required column names from the Create XML Generator Control Table component, and apply these to the output of the Table Creator before passing it on to XML Generator.Write XML.This needs to be configuredwith the required outputFolder.The filename is as specifiedon the config of XML Generatorprovides quick link variable toworkflow's data folderView the generatedXML in a browser or other appassociated with .xmlfilesManually EditedControl table originally createdby the Create XML Generator Control Table componentApplies the column namesfrom the Create XML Generator Control Tablecomponent onto the Table Creatoroutput.Sort by native-country Local FileName Variables CSV Reader XML Generator Create XML GeneratorControl Table XML Writer Local FileName Variables Java Edit Variable Table Creator Rename TableCreator Columns Sorter XML Generator Demo 2- Read a CSV and output xmlwith manual editing of the control table to specify therequired outputREQUIRES PYTHON 3 to be installed in your KNIMEenvironment For demo purposes, launch the output filein the associated xml app in your environment.Remove this node if you have no associatedapp, or you don't wish to launch it. The "advanced" XML generation is performed by XML Generator being controlled by the MANUALLY EDITED control table, supplied by Table CreatorIf you set your Python Console Logging level to INFO, you will see a progress message every 1000 rows logged by the XML 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. "Local File Name Variables" components allow meto quickly provide a file name relative to theworkflow's data folder, or a link to the data folderitself. It then creates variables of type String, Pathand URL so there is a variable suitable for bothlegacy (deprecated) and newer file componentswithout me having to care! The upper output port on XML Generator is the data in singleXML format, declared as KNIME XML data typeThe lower output 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 rows 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!)Generates 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_xmlThe control table generated in demo1 has now been manuallycopied/pasted into Table Creator whereupon it can be edited.I am too lazy to rename the columns in Table Creator soI used by "Rename Table Creator Columns" componentto receive the required column names from the Create XML Generator Control Table component, and apply these to the output of the Table Creator before passing it on to XML Generator.Write XML.This needs to be configuredwith the required outputFolder.The filename is as specifiedon the config of XML Generatorprovides quick link variable toworkflow's data folderView the generatedXML in a browser or other appassociated with .xmlfilesManually EditedControl table originally createdby the Create XML Generator Control Table componentApplies the column namesfrom the Create XML Generator Control Tablecomponent onto the Table Creatoroutput.Sort by native-countryLocal FileName Variables CSV Reader XML Generator Create XML GeneratorControl Table XML Writer Local FileName Variables Java Edit Variable Table Creator Rename TableCreator Columns Sorter

Nodes

Extensions

Links