This tool accepts any valid XML with a single root element:
<tool> <name>Google Sheets</name> <category>Spreadsheet</category> <pricing>Free</pricing> </tool>
Note: The XML must have exactly one root element. If your XML has multiple root elements, wrap them in a single parent tag.
Each XML element becomes a JSON key, and its content becomes the value. The result of the above XML will be:
{
"tool": {
"name": "Google Sheets",
"category": "Spreadsheet",
"pricing": "Free"
}
}If your XML element has attributes, they are grouped under the $ key in the JSON
output.
<tool id="excel-365" platform="windows"> <name>Microsoft Excel</name> </tool>
becomes:
{
"tool": {
"$": {
"id": "excel-365",
"platform": "windows"
},
"name": "Microsoft Excel"
}
}When an element has attributes or child elements along with text content, the text is
stored under the _ key.
<price plan="pro">9.99</price>
becomes:
{
"price": {
"$": {
"plan": "pro"
},
"_": "9.99"
}
}When multiple elements share the same name, they are automatically converted into a JSON array.
<productivity-tools> <tool>Notion</tool> <tool>Trello</tool> <tool>Airtable</tool> </productivity-tools>
becomes:
{
"productivity-tools": {
"tool": ["Notion", "Trello", "Airtable"]
}
}Note: Single elements remain as objects, not arrays. Arrays are only created when there are multiple elements with the same name.
Yes, CDATA sections are treated as text content. This is useful for including code or special characters.
<formula><![CDATA[ =IF(A1>100, "High", "Low") ]]></formula>
becomes:
{
"formula": "=IF(A1>100, \"High\", \"Low\")"
}