Start building

Transform and map

XML lines → mapped JSON collection

Map an XPath node set rather than the first scalar. Repeated XML elements become JSON objects with exact decimal calculations.

  • XML → JSON
  • Advanced
  • 5 min

Last verified 2026-10-31 at f4ce7d0 — simulation fixtures

Try this template in Studio

Studio activation is a one-time payment of USD 20.

Flow

Drawn at build time from the node positions in the template's process definitions. Numbered markers are the walkthrough stages.

Main processXML lines → mapped JSON collection3 activities

Scroll sideways to see the whole flow.

Flow diagram of XML lines → mapped JSON collection3 activities and 2 transitions: Typed input, Map every XML line, Return result.Typed inputstartMap every XML linedata.mapper1Return resultend
List the 3 activities and 2 transitions

Activities

  1. Typed input start
  2. Map every XML line data.mapper
  3. Return result end

Transitions

  • Typed input → Map every XML line (on success)
  • Map every XML line → Return result (on success)

Walkthrough

  1. Map the XML node setXPath returns each Line as an XML envelope. Each iteration maps its SKU and amount.

What you will practise

  • XPath returns each Line as an XML envelope. Each iteration maps its SKU and amount.

Sample cases

1 case with 4 assertions, run with python -m server.integration examples --all in simulation.

Two namespaced XML lines

Passed

Two namespaced XML lines. This example uses supplied data only.

Expected result Two namespaced XML lines; automatic checks verify the expected result.

4/4 assertions

  • Expected process status
  • Verify /items/0/sku
  • Verify /items/0/amount
  • Verify /items/1/amount

This sample run only; not a production certification.

Prerequisites

Runtime
Cohuno runtime 1.27.0, the version recorded when these cases last passed.
Starter
Manual start; no listener.
Optional dependencies
None beyond the base runtime.
Simulation fixtures
None: no activity in this template uses a connector.
Verification details

Provenance

What was verified, and when. The content part changes whenever the pack, a process in its closure, the runtime version or a case result changes; the gallery check then fails until the gallery is regenerated and the changed templates are verified again.

Verified content

Pack SHA-256
261d4a9442525cf0256701519a34d58c8f6dec43b1535dac8bac82e5f544df1f
Closure SHA-256
15b15169ec8869f98b9d97b62b5ebc994de2e8b25310ba63c5af9fdef104850b
Runtime
1.27.0
Results
1/1 cases, 4/4 assertions, mode simulate, external calls: none.
Files in the closure
  • server/integration/example_packs/xml_collection_lab.json
  • server/integration/templates/xml_collection_lab.json

Verification event

Commit
f4ce7d08eedc90267b405ed1974344153a8b3a34
Verified at (UTC)
2026-10-31T21:19:21Z

How the Cohuno team reproduces this check

PYTHONPATH=. python -m server.integration examples --example xml_collection_lab
PYTHONPATH=. python scripts/export_public_gallery.py --check