Task and prerequisites

Select repeating XML elements, use the id attribute as the code and write the catalog to Excel.

This example uses demonstration data and settings. Validate the expected result in your own environment before connecting production destinations. Identifiers demo_* are illustrative: select your own training connections or sources in the editor. The JSON below shows the block and connection structure, not a ready-to-transfer flow archive.

Training input data

<catalog><item id="T01"><name>Tea</name><unit>pack</unit></item><item id="C01"><name>Coffee</name><unit>bag</unit></item></catalog>

Blocks, connections and exact settings

Explanatory diagramEnlarge ↗04. XML: product catalog to Excel. Example 04 topology: 3 blocks, 2 connections. Node identifiers and ports from the configured graph are preserved.
Flow diagram 04

Example 04 topology: 3 blocks, 2 connections. Node identifiers and ports from the configured graph are preserved.

Add the listed blocks in the designer, open each block's properties and set these values. Names demo_* identify training sources and connections.

BlockSetting
1
File
src
  • Role: source
  • Source: demo_catalog_xml
  • Read settings:
    • XML record path: ./item
    • Range: A1:C3
    • First row is the header: так
2
Column mapping
map
  • Mode: columns
  • Columns:
      • Name: ProductCode
      • Value: @id
      • Name: ProductName
      • Value: name
      • Name: Unit
      • Value: unit
3
Data export
out
  • Format: xlsx
  • File name: catalog
  • Purpose: download
  • Delimiter: ;
  • Time zone: Europe/Kyiv

Port connections

  • src out → map in
  • map out → out in
Complete graph configuration as JSON
{
  "version": 3,
  "nodes": [
    {
      "id": "src",
      "type": "file",
      "label": "src",
      "config": {
        "role": "source",
        "source_id": "demo_catalog_xml",
        "options": {
          "xml_path": "./item",
          "range": "A1:C3",
          "header": true
        }
      }
    },
    {
      "id": "map",
      "type": "mapping",
      "label": "map",
      "config": {
        "mode": "columns",
        "columns": [
          {
            "name": "ProductCode",
            "value": "@id"
          },
          {
            "name": "ProductName",
            "value": "name"
          },
          {
            "name": "Unit",
            "value": "unit"
          }
        ]
      }
    },
    {
      "id": "out",
      "type": "export",
      "label": "out",
      "config": {
        "format": "xlsx",
        "filename": "catalog",
        "destination": "download",
        "delimiter": ";",
        "timezone": "Europe/Kyiv"
      }
    }
  ],
  "edges": [
    {
      "source": "src",
      "target": "map",
      "source_port": "out",
      "target_port": "in"
    },
    {
      "source": "map",
      "target": "out",
      "source_port": "out",
      "target_port": "in"
    }
  ]
}

Expected result

ProductCodeProductNameUnit
T01Teapack
C01Coffeebag

Run and verify

  1. Upload the XML as catalog.xml. Select path ./item from the catalog root.
  2. Check the source's available fields: @id, name and unit.
  3. Run the flow; catalog.xlsx should contain 2 products and 3 columns.

Common errors

  • The id attribute is available as @id, not id.
  • Path ./catalog/item is redundant if catalog is already the document root.
  • Repeated nested tags can produce complex values; this example deliberately uses simple elements.