Skip to content

Commit 23544ee

Browse files
committed
Fix review suggestions
1 parent 595997c commit 23544ee

File tree

1 file changed

+22
-19
lines changed

1 file changed

+22
-19
lines changed

en/docs/integration-guides/usecases/datamapper/read-csv-file-and-transform-to-xml-file.md

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Read a CSV File and Transform It to an XML File
1+
# Read a CSV File and Transform It to XML File
22

33
## Overview
44
This is a low-code walkthrough that uses the Ballerina Integrator Data Mapper and file APIs to build an end-to-end pipeline — without writing code by hand. You will:
@@ -8,6 +8,13 @@ This is a low-code walkthrough that uses the Ballerina Integrator Data Mapper an
88
3. Add a row number as a child `<index>` element. Use the mapper’s row position function and set it to 0-based.
99
4. Write the result to a new XML file in an `output/` folder.
1010

11+
### Why this use case
12+
13+
- Converts flat CSV order data into XML that downstream, XML-centric systems can validate and consume.
14+
- Demonstrates record indexing as an element (`<index>`) for traceability back to the original row.
15+
- Scales easily from a single file to batch folders or listener-based near-real-time ingestion.
16+
17+
1118
### Input CSV Example
1219

1320
```csv
@@ -45,12 +52,6 @@ S003,P-2003,1,89.50
4552
</Orders>
4653
```
4754

48-
### Why this use case
49-
50-
- Converts flat CSV order data into XML that downstream, XML-centric systems can validate and consume.
51-
- Demonstrates record indexing as an element (`<index>`) for traceability back to the original row.
52-
- Scales easily from a single file to batch folders or listener-based near-real-time ingestion.
53-
5455
## Prerequisites
5556

5657
Before you begin, make sure you have the following:
@@ -65,16 +66,18 @@ WSO2 Integrator: BI extension provides a low-code graphical environment to visua
6566
1. Launch VS Code and click the WSO2 Integrator: BI icon on the left sidebar.
6667
You’ll be taken to the welcome page that introduces the integration workspace.
6768

68-
2. Under the **Get Started Quickly** section, you’ll see three main options:
69-
- Create New Integration – start a new integration project from scratch using the graphical designer.
70-
- Import External Integration – bring in existing integrations from other platforms (e.g., MuleSoft, TIBCO).
71-
- Explore Pre-Built Samples – open existing templates or tutorials.
69+
2. Under the **Get Started Quickly** section, you’ll see three main options:
70+
71+
- Create New Integration – start a new integration project from scratch using the graphical designer.
72+
- Import External Integration – bring in existing integrations from other platforms (e.g., MuleSoft, TIBCO).
73+
- Explore Pre-Built Samples – open existing templates or tutorials.
7274

73-
3. Click **Create New Integration**.
75+
3. Click **Create New Integration**.
7476
This opens the integration creation wizard, where you can:
75-
- Define the integration name and location.
76-
- Choose to start with a blank project or from a sample template.
77-
- Initialize the workspace structure with folders for input/output mappings, resources, and configuration.
77+
78+
- Define the integration name and location.
79+
- Choose to start with a blank project or from a sample template.
80+
- Initialize the workspace structure with folders for input/output mappings, resources, and configuration.
7881

7982
4. Once the project is created, you’ll enter the graphical integration designer view.
8083
From here, you can start adding connectors, data mappings, and logic components to build your flow visually.
@@ -118,7 +121,7 @@ These parameters make your integration portable and environment-agnostic — you
118121
<a href="{{base_path}}/assets/usecases/datamapping/csv-to-xml-simple-mapping/img/csv_to_xml2.gif"><img src="{{base_path}}/assets/usecases/datamapping/csv-to-xml-simple-mapping/img/csv_to_xml2.gif" alt="Add configurable file paths" width="70%"></a>
119122

120123
---
121-
## Step 3: Create a structure to represent each CSV row
124+
## Step 3: Create a structure to represent each csv row
122125

123126
In this step, you’ll define a structure (called a *Type* in Ballerina) that describes what one row in your CSV file looks like.
124127
Think of it as creating a template so the Data Mapper can recognize each column by name and map them correctly to the XML later.
@@ -146,7 +149,7 @@ When the system reads the CSV file, it will treat every line (after the header)
146149
<a href="{{base_path}}/assets/usecases/datamapping/csv-to-xml-simple-mapping/img/csv_to_xml3.gif"><img src="{{base_path}}/assets/usecases/datamapping/csv-to-xml-simple-mapping/img/csv_to_xml3.gif" alt="Create a type to represent CSV structure" width="70%"></a>
147150

148151
---
149-
## Step 4: Generate XML types from a sample payload
152+
## Step 4: Generate xml types from a sample payload
150153

151154
In this step, you’ll create the XML output structure automatically by pasting a sample XML.
152155
The Integrator’s Type Creator reads this example and builds the corresponding type definitions for you.
@@ -197,7 +200,7 @@ The generated structure will appear as:
197200
└─ price: decimal
198201
```
199202

200-
You now have a record type that defines the exact structure of your output XML file.
203+
You now have an record type that defines the exact structure of your output xml file.
201204
This type will act as the target structure in the Data Mapper, allowing each `CSV` record to be mapped directly into a `<Row>` element under `<Orders>`.
202205

203206
<a href="{{base_path}}/assets/usecases/datamapping/csv-to-xml-simple-mapping/img/csv_to_xml4.gif"><img src="{{base_path}}/assets/usecases/datamapping/csv-to-xml-simple-mapping/img/csv_to_xml4.gif" alt="Create a type to represent XML structure" width="70%"></a>
@@ -226,7 +229,7 @@ This automation serves as the starting point of the data-transformation pipeline
226229

227230
A page titled **Automation – An automation that can be invoked periodically or manually** appears.
228231
Click the blue **Create** button to add a new Automation flow.
229-
You may optionally expand **Advanced Configurations** to adjust scheduling or trigger settings, but for this tutorial, we keep the defaults.
232+
You may optionally expand *Optional Configurations* to adjust scheduling or trigger settings, but for this tutorial we keep defaults.
230233

231234
The tool shows a brief **“Creating…”** indicator, and then a new canvas opens.
232235

0 commit comments

Comments
 (0)