Built-in apps

XML

8min
with the xml app in {{product name}} , you can manage, parse, and bundle xml formatted text you do not need to establish a connection to use the xml app xml modules you can use the following types of modules to build your {{scenario plural lowercase}} searches perform xpath query field description xml enter the source xml document xpath query enter the query in the xpath language transformers create xml converts a bundle to an xml formatted text field description data structure describes the structure of the resulting xml if you have a sample of the xml you would like to parse, you can use it to generate the data structure click add click generate copy and paste the xml sample into the sample data field click save verify that the data structure has been successfully generated click save to save the data structure example create xml a typical use case is to transform data from a google spreadsheet into xml place the google sheets > select rows module in your {{scenario singular lowercase}} to fetch the data setup the module to retrieve rows from your google spreadsheet and set the maximum number of returned rows to a small number, but larger than one for testing purposes (e g three) run the google sheets module (right click it and choose "run this module only") and verify the output of the module connect the array aggregator module after the google sheets module in the module's setup choose the google sheets module in the source node field leave the other fields as they are for the moment connect the xml > create xml module after the array aggregato r module the module's setup requires a data structure that describes the structure of the xml output click on add to open the data structure setup the easiest way to create this data structure is to generate it automatically from an xml sample click on generate and paste your xml sample to the sample data field create xml step 3 click save the specification field in the data structure setup should now contain the generated structure change the name of your data structure to something more specific (e g "my xml data structure") and click save a field corresponding to the root xml element should appear as a mappable field in the xml module's setup click map next to the field and map the array\[] item output from the array aggregator module click ok to close the xml module's setup open the setup of the array aggregator module change the target structure from custom to an xml module's field corresponding to the parent xml element map items output from the google sheets module to appropriate fields create xml step 8 click ok to close the array aggregator module's setup run the scenario the xml module should output the correct xml file open the setup of the google sheets module and increase the maximum number of returned rows number to be larger than the number of rows in your spreadsheet to process all the data the resulting xml can be then saved to dropbox, sent as an attachment via email, uploaded via ftp to a server, etc example add xml attributes if you want to add attributes to a complex node (a node, that will contain other nodes), you have to add a collection with the name attributes for this node in your custom data structure, and this collection will be mapped to node attributes if you want to add attributes to a text node (example \<node attr="1">abc\</node> ), you have to add a collection attributes for attributes and a text property value for the node value for this node in your custom data structure { "name" "node", "type" "collection", "spec" \[ { "name" " attributes", "type" "collection" "spec" \[ { "name" "attr1", "type" "text" } ] }, { "name" " value", "type" "text" } ] } parse xml parses an xml formatted text and outputs a single bundle containing all the information extracted from the xml field description data structure select or add a date structure describes the structure of the xml to make the output of the module available in the mapping panel for the modules that follow if you have a sample of the xml you would like to parse, you can use it to generate the data structure click add click generate copy and paste the xml sample into the sample data field click save verify that the data structure has been successfully generated click save to save the data structure you can skip steps 2 5 to supply an empty data structure this way the output of the module will not be available in the mapping panel until the module has been executed at least once to process an xml input xml enter the xml to parse if you use a formula, make sure its result value type is (or can be automatically changed to) text type if the result value type is buffer (binary data) then use tostring() function to convert it to the text type example parse xml a typical use case is to download an xml file from a url and parse its content here is a step by step guide how to achieve this create a new {{scenario singular lowercase}} add an http > get a file module configure the module add the url of the xml file configure the module click ok add the xml > parse xml module, connect it after the http > get a file module and configure it data structure field click add click generate in your web browser, open a new tab/window enter the url you used in the third step in the address bar and fetch the xml file select all the xml text and copy it into the clipboard close the tab/window and get back to your {{scenario singular lowercase}} paste the copied xml text into the sample data field click save verify that the data structure has been successfully generated click save to save the data structure you can skip these steps to supply an empty data structure this way the output of the module will not be available in the mapping panel until the module has been executed at least once to process an xml input xml field map the data item from the output of the http > get a file into this field use the tostring() function to convert its value from buffer (binary data) type to text type you may copy and paste the formula's code into the field {{tostring(1 data)}} example parse xml attributes by default, the xml > parse xml module will put attributes in a special collection attributes as a child of the node that has these attributes if the node is a text node and it has attributes, then two special properties will be added attributes for attributes and value for the text content of the node \<root attr="1"> \<node attr="abc">hello, world\</node> \</root>