XML to JSON

Convert repeated XML elements to a JSON array and check how the result represents their parent.

Convert repeated XML elements to a JSON array and check how the result represents their parent.

How to use

  1. Use the sample items element containing item entries for Tea and Café.
  2. Convert to JSON and locate the item property in the result.
  3. Check that its array contains both strings in order, including the accent in Café.

Worked example

Input

<items><item>Tea</item><item>Café</item></items>

Expected result

{"item":["Tea","Café"]}

Check the result

The output is {"item":["Tea","Café"]}. The outer items name is omitted.

Continue with another guide

Cookie
We care about your data and would love to use cookies to improve your experience.

Learn how we use cookies