How can i read stream xml file using Node red

Node-red to read XML file

Use xml Node.

Preceded by a File Read node of course.

how can I use the Node, please?

What have you tried so far? Make sure you read the help text for the node.

Are you a beginner with node-red? If so then I recommend watching this playlist: Node-RED Essentials. The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.

So you see the XML node converts the XML file into a JS Object in the msg.payload and can be directly used further or a JS Object will be converted into a XML file

books.txt (4,4 KB)

You need to adapt the file read node to read your xml file.

[
    {
        "id": "f4cc57ee920b7cfb",
        "type": "file in",
        "z": "f87aa05e3297dcd1",
        "name": "",
        "filename": "H:\\books.txt",
        "format": "utf8",
        "chunk": false,
        "sendError": false,
        "encoding": "none",
        "allProps": false,
        "x": 570,
        "y": 880,
        "wires": [
            [
                "d6f801e6a8cf89e2"
            ]
        ]
    },
    {
        "id": "6007593cedca3cea",
        "type": "debug",
        "z": "f87aa05e3297dcd1",
        "name": "Óutput JS Object",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 910,
        "y": 880,
        "wires": []
    },
    {
        "id": "e7e35ef120976dd1",
        "type": "inject",
        "z": "f87aa05e3297dcd1",
        "name": "",
        "props": [
            {
                "p": "trigger",
                "v": "true",
                "vt": "bool"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 370,
        "y": 880,
        "wires": [
            [
                "f4cc57ee920b7cfb"
            ]
        ]
    },
    {
        "id": "d6f801e6a8cf89e2",
        "type": "xml",
        "z": "f87aa05e3297dcd1",
        "name": "",
        "property": "payload",
        "attr": "",
        "chr": "",
        "x": 730,
        "y": 880,
        "wires": [
            [
                "6007593cedca3cea",
                "aae6c8cea7b7f6d5"
            ]
        ]
    },
    {
        "id": "aae6c8cea7b7f6d5",
        "type": "xml",
        "z": "f87aa05e3297dcd1",
        "name": "",
        "property": "payload",
        "attr": "",
        "chr": "",
        "x": 890,
        "y": 940,
        "wires": [
            [
                "7d08e59b1984cd6e"
            ]
        ]
    },
    {
        "id": "7d08e59b1984cd6e",
        "type": "debug",
        "z": "f87aa05e3297dcd1",
        "name": "Output XML File",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1060,
        "y": 940,
        "wires": []
    }
]

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