diff --git a/packages/node_modules/@node-red/nodes/examples/parser/xml/01 - Convert JavaScript object to XML.json b/packages/node_modules/@node-red/nodes/examples/parser/xml/01 - Convert JavaScript object to XML.json new file mode 100644 index 000000000..3a97c8498 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/examples/parser/xml/01 - Convert JavaScript object to XML.json @@ -0,0 +1,92 @@ +[ + { + "id": "82f1bd0b.43474", + "type": "xml", + "z": "4b63452d.672afc", + "name": "", + "property": "payload", + "attr": "", + "chr": "", + "x": 530, + "y": 180, + "wires": [ + [ + "1cd4ad02.9a5423" + ] + ] + }, + { + "id": "84222b92.d65d18", + "type": "inject", + "z": "4b63452d.672afc", + "name": "", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "payload": "", + "payloadType": "date", + "x": 200, + "y": 180, + "wires": [ + [ + "cdd1c154.3a655" + ] + ] + }, + { + "id": "7b014430.dfd94c", + "type": "comment", + "z": "4b63452d.672afc", + "name": "Convert JavaScript object to XML", + "info": "XML node can convert JavaScript object to XML string.", + "x": 240, + "y": 120, + "wires": [] + }, + { + "id": "1cd4ad02.9a5423", + "type": "debug", + "z": "4b63452d.672afc", + "name": "", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "false", + "statusVal": "", + "statusType": "auto", + "x": 690, + "y": 180, + "wires": [] + }, + { + "id": "cdd1c154.3a655", + "type": "template", + "z": "4b63452d.672afc", + "name": "JS object", + "field": "payload", + "fieldType": "msg", + "format": "json", + "syntax": "plain", + "template": "{\n \"kind\": \"Apple\",\n \"price\": 100,\n \"origin\": \"Canada\"\n}", + "output": "json", + "x": 360, + "y": 180, + "wires": [ + [ + "82f1bd0b.43474" + ] + ] + } +] \ No newline at end of file diff --git a/packages/node_modules/@node-red/nodes/examples/parser/xml/02 - Convert XML to JavaScript object.json b/packages/node_modules/@node-red/nodes/examples/parser/xml/02 - Convert XML to JavaScript object.json new file mode 100644 index 000000000..5e46428ef --- /dev/null +++ b/packages/node_modules/@node-red/nodes/examples/parser/xml/02 - Convert XML to JavaScript object.json @@ -0,0 +1,92 @@ +[ + { + "id": "93e423a9.a407d", + "type": "xml", + "z": "4b63452d.672afc", + "name": "", + "property": "payload", + "attr": "", + "chr": "", + "x": 530, + "y": 360, + "wires": [ + [ + "2d0dde7e.a50082" + ] + ] + }, + { + "id": "ba1dab90.8d1da8", + "type": "inject", + "z": "4b63452d.672afc", + "name": "", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "payload": "", + "payloadType": "date", + "x": 200, + "y": 360, + "wires": [ + [ + "16617f26.14ced1" + ] + ] + }, + { + "id": "a9f97b00.57d658", + "type": "comment", + "z": "4b63452d.672afc", + "name": "Convert XML to JavaScript object", + "info": "XML node can convert XML string to JavaScript object.", + "x": 240, + "y": 300, + "wires": [] + }, + { + "id": "2d0dde7e.a50082", + "type": "debug", + "z": "4b63452d.672afc", + "name": "", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "false", + "statusVal": "", + "statusType": "auto", + "x": 690, + "y": 360, + "wires": [] + }, + { + "id": "16617f26.14ced1", + "type": "template", + "z": "4b63452d.672afc", + "name": "XML string", + "field": "payload", + "fieldType": "msg", + "format": "html", + "syntax": "plain", + "template": "\n\n Apple\n 100\n Canada\n", + "output": "str", + "x": 370, + "y": 360, + "wires": [ + [ + "93e423a9.a407d" + ] + ] + } +] \ No newline at end of file diff --git a/packages/node_modules/@node-red/nodes/examples/parser/xml/03 - Control conversion using options property.json b/packages/node_modules/@node-red/nodes/examples/parser/xml/03 - Control conversion using options property.json new file mode 100644 index 000000000..7a3c39f7e --- /dev/null +++ b/packages/node_modules/@node-red/nodes/examples/parser/xml/03 - Control conversion using options property.json @@ -0,0 +1,119 @@ +[ + { + "id": "581bd648.636628", + "type": "xml", + "z": "4b63452d.672afc", + "name": "", + "property": "payload", + "attr": "", + "chr": "", + "x": 710, + "y": 540, + "wires": [ + [ + "b74237dc.1e5028" + ] + ] + }, + { + "id": "d0899f9b.f1ac6", + "type": "inject", + "z": "4b63452d.672afc", + "name": "", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "payload": "", + "payloadType": "date", + "x": 200, + "y": 540, + "wires": [ + [ + "f04ffb9a.68edb8" + ] + ] + }, + { + "id": "8a214c05.dc61f", + "type": "comment", + "z": "4b63452d.672afc", + "name": "Control conversion using options property", + "info": "XML node can control conversion by setting `options` property (defined by [xml2js](https://github.com/Leonidas-from-XIV/node-xml2js/blob/master/README.md#options)) in input message.", + "x": 260, + "y": 480, + "wires": [] + }, + { + "id": "b74237dc.1e5028", + "type": "debug", + "z": "4b63452d.672afc", + "name": "", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "false", + "statusVal": "", + "statusType": "auto", + "x": 870, + "y": 540, + "wires": [] + }, + { + "id": "f04ffb9a.68edb8", + "type": "template", + "z": "4b63452d.672afc", + "name": "XML string", + "field": "payload", + "fieldType": "msg", + "format": "html", + "syntax": "plain", + "template": "\n\n Apple\n 100\n Canada\n", + "output": "str", + "x": 370, + "y": 540, + "wires": [ + [ + "fedf79.5889c088" + ] + ] + }, + { + "id": "fedf79.5889c088", + "type": "change", + "z": "4b63452d.672afc", + "name": "set options", + "rules": [ + { + "t": "set", + "p": "options", + "pt": "msg", + "to": "{\"explicitArray\":false}", + "tot": "json" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 550, + "y": 540, + "wires": [ + [ + "581bd648.636628" + ] + ] + } +] \ No newline at end of file