XML to Data
XML to Data reads text in XML format and turns it into NappAI data, so the following components can use each field separately. XML organises information with tags, such as <customer><name>Ana</name></customer>, and is common in management, invoicing and public administration systems.
When to use it
- Use the XML response of an ERP or a supplier in your flow.
- Read invoices or orders that arrive as XML.
- Process information from public or industry services that publish XML.
- Test a flow with a sample XML that you type by hand.
Configuration
| Field | What it does |
|---|---|
| Mode | How you provide the XML. Data Entry (default): you connect it from another component. Manual Entry: you type it in the component. |
| XML Data (required with Data Entry) | The data containing the XML. The component takes the text from its xml field or, if there is none, from its text field. It also accepts the XML text directly. You can connect several. |
| XML Text (required with Manual Entry) | The XML text you type. |
Output
The Data output returns one record for each XML:
- Each tag becomes a field with the same name.
- Tags that repeat are grouped into a list.
- The main tag that wraps all the content does not appear as a field.
- Values that contain only a number come out as numbers, and
trueandfalseas yes/no values. Texts that carry an identifier rather than a quantity, such as"08001","+34600123456"or"3.10", stay as text so no digit is lost.
Connect the output to any component that works with data.
Example
Your supplier answers each stock query with an XML containing several <item> tags. XML to Data turns it into a record with an item list, and an agent uses that list to tell the customer which products arrive this week.
Related components
- Data to XML: the reverse step.
- JSON to Data: the same for JSON.