Read xml file

Hello,

I am new to n8n, I have a quick question please

I have xml files locally, and I want to read these files.
how to do it please?

Hey @Nabil_Touijer!

Welcome to the community!

Firstly, since this is a question I am moving this post to the questions category. To answer your question, you can use the Read Binary File node to read the local file.

Hope this helps :slightly_smiling_face:

thank you for your reply

I am using the binary read file, but I want to manipulate the XML data
I can’t see the data

{
  "nodes": [
    {
      "parameters": {
        "fileName": "/var/www/html/ETM/file/test.xml"
      },
      "name": "Write Binary File",
      "type": "n8n-nodes-base.writeBinaryFile",
      "typeVersion": 1,
      "position": [
        1420,
        330
      ]
    },
    {
      "parameters": {
        "filePath": "=/var/www/html/ETM/file/EM_30037_030_20201027_102422.xml",
        "dataPropertyName": "=data {{$parameter[\"filePath\"]}}"
      },
      "name": "Read Binary File",
      "type": "n8n-nodes-base.readBinaryFile",
      "typeVersion": 1,
      "position": [
        1010,
        350
      ]
    },
    {
      "parameters": {
        "triggerTimes": {
          "item": [
            {}
          ]
        }
      },
      "name": "Cron",
      "type": "n8n-nodes-base.cron",
      "typeVersion": 1,
      "position": [
        660,
        350
      ]
    },
    {
      "parameters": {},
      "name": "IF",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        1200,
        340
      ]
    },
    {
      "parameters": {
        "fileName": "/var/www/html/ETM/file/test.xml"
      },
      "name": "Write Binary File1",
      "type": "n8n-nodes-base.writeBinaryFile",
      "typeVersion": 1,
      "position": [
        1420,
        480
      ]
    }
  ],
  "connections": {
    "Read Binary File": {
      "main": [
        [
          {
            "node": "IF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Cron": {
      "main": [
        [
          {
            "node": "Read Binary File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF": {
      "main": [
        [
          {
            "node": "Write Binary File",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Write Binary File1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

You can have a look at this workflow:

It shows how you convert XML to JSON. The only difference is that it gets the file from Dropbox instead of the local filesystem.

Thanks Jan