XML to JSON dosent work

Using the XML to JSON node, but when i give it XML data i get a error

{
  "errorMessage": "Item has no JSON property called \"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<note>\n  <to>Tove</to>\n  <from>Jani</from>\n  <heading>Reminder</heading>\n  <body>Don't forget me this weekend!</body>\n</note>\"",
  "errorDetails": {},
  "n8nDetails": {
    "nodeName": "XML3",
    "nodeType": "n8n-nodes-base.xml",
    "nodeVersion": 1,
    "itemIndex": 0,
    "time": "2024-10-19 22:05:09",
    "n8nVersion": "1.63.4 (Cloud)",
    "binaryDataMode": "filesystem",
    "stackTrace": [
      "NodeOperationError: Item has no JSON property called \"<?xml version=\"1.0\" encoding=\"UTF-8\"?>",
      "<note>",
      "  <to>Tove</to>",
      "  <from>Jani</from>",
      "  <heading>Reminder</heading>",
      "  <body>Don't forget me this weekend!</body>",
      "</note>\"",
      "    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Xml/Xml.node.js:233:31)",
      "    at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:722:42)",
      "    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:711:66",
      "    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:1141:20"
    ]
  }
}
  • Running n8n via n8n cloud

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Welcome to the community @Hjalmarsson !

Tip for sharing information

Pasting your n8n workflow


Ensure to copy your n8n workflow and paste it in the code block, that is in between the pairs of triple backticks, which also could be achieved by clicking </> (preformatted text) in the editor and pasting in your workflow.

```
<your workflow>
```

That implies to any JSON output you would like to share with us.

Make sure that you have removed any sensitive information from your workflow and include dummy or pinned data with it!


What is the actual XML you are trying to convert to JSON? Most likely you have not configured the node correctly for the data in question.

Have XML comming from a diffrent system, but to elimitate the data is wrong i have tried by sample XML like this:

<?xml version="1.0" encoding="UTF-8"?>
<note>
  <to>Tove</to>
  <from>Jani</from>
  <heading>Reminder</heading>
  <body>Don't forget me this weekend!</body>
</note>

Hey @Hjalmarsson , thanks for the details. As I suspected you did not configure the node correctly. Here’s a working example for your understanding.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.