XML node gives an error with Invalid character

Hi!

Describe the issue/error/question

What is the error message (if any)?

ERROR: Invalid character in entity name Line: 15773 Column: 49 Char:

Please share the workflow

Share the output returned by the last node

Error: Invalid character in entity name
Line: 15773
Column: 49
Char:  
    at error (/usr/local/lib/node_modules/n8n/node_modules/sax/lib/sax.js:667:10)
    at strictFail (/usr/local/lib/node_modules/n8n/node_modules/sax/lib/sax.js:693:7)
    at SAXParser.write (/usr/local/lib/node_modules/n8n/node_modules/sax/lib/sax.js:1504:13)
    at Parser.exports.Parser.Parser.parseString (/usr/local/lib/node_modules/n8n/node_modules/xml2js/lib/parser.js:323:31)
    at Parser.parseString (/usr/local/lib/node_modules/n8n/node_modules/xml2js/lib/parser.js:5:59)
    at /usr/local/lib/node_modules/n8n/node_modules/xml2js/lib/parser.js:338:24
    at new Promise (<anonymous>)
    at Parser.exports.Parser.Parser.parseStringPromise (/usr/local/lib/node_modules/n8n/node_modules/xml2js/lib/parser.js:336:14)
    at Parser.parseStringPromise (/usr/local/lib/node_modules/n8n/node_modules/xml2js/lib/parser.js:5:59)
    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Xml/Xml.node.js:223:47)

Is there any way to convert to a valid JSON format?

Thank you very much!

Information on your n8n setup

  • n8n version: 0.197.1
  • Database you’re using (default: SQLite): SQLite
  • Running n8n with the execution process [own(default), main]:
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: Docker

Hey @Mikhail,

The issue doesn’t appear to be with the node, I have ran your XML file against an online validation service and it shows the same error message. You can check with this service: https://codebeautify.org/xmlvalidator

1 Like

Hey @Jon

Thank you so much for answering!

Yes, I noticed something strange about the source, too. I will deal with it, maybe they will fix this error.
Thanks for the link, I will use it!

1 Like

There was an “&” sign in the XML, which caused an error. Now this sign has been removed from the source and everything seems to work.

1 Like

delete (​​​Post must be at least 10 character)