// guides · n8n error index

n8n XML node not working: parse errors, one item vs array, attributes and Split Out, 39 runs

Why the n8n XML node fails or gives odd JSON: Item has no JSON property called "data", Non-whitespace before first tag, one item that is not an array, attributes under _ and $, binary files, JSON to XML errors. 39 real runs on n8n 2.43.7.

Updated 2026-10-24 · about 10 minutes

Still stuck after these steps? Paste your exact n8n error and we'll reproduce it and email you the fix, free →

Steps

  1. Give the XML node a text field, not a file

    The XML node only reads a JSON string field, set in Property Name (default data). A binary .xml file sent straight into it failed with Item has no JSON property called "data". For files, add Extract From File with the operation Extract From XML first, then the XML node: that parsed fine, and an ISO-8859-1 file came out with correct accents. The same error appears when your text is in another field, for example an HTTP response in body: set Property Name to body.

  2. Turn on Explicit Array before Split Out

    With the default options, two <item> elements become an array, but one <item> becomes a plain object. Split Out on rss.channel.item then split the single object's fields into 3 junk items, while the 2-item feed split correctly. So a workflow that works on most days breaks the day the feed or API returns one result. Turn on Options, Explicit Array (every value becomes an array, so reference title[0]), or normalize it in an expression: {{ [].concat($json.rss.channel.item) }}.

  3. Know where attributes and text go

    By default attributes are merged as plain keys (id, version, currency). An element that has attributes and text, like <price currency="EUR">19.90</price>, becomes {"_":"19.90","currency":"EUR"}, so $json.price is an object and the text is $json.price._. Merge Attributes off puts attributes under $. Ignore Attributes drops them and gives price as plain "19.90". Explicit Root off removes the outer key (rss), and Normalize Tags lowercases names.

  4. Convert numbers yourself

    Every value comes out as a string: "19.90", and "0042" keeps its leading zeros. Comparisons in IF, Filter or Switch with number operators then hit type errors or compare text. Use {{ Number($json.price._) }} or the Edit Fields node with type Number.

  5. Read the parse error: it is usually not XML

    If the input isn't XML, the run fails. HTML with <br> gave Unexpected close tag. A JSON string gave Non-whitespace before first tag. with Char {: the API returned JSON, so you don't need the XML node. An object field gave the same error with Char [, because n8n turned it into [object Object]. A bare & (Tom & Jerry) gave Invalid character in entity name, and truncated XML gave Unclosed root tag. An empty string gave the confusing Cannot read properties of null (reading '$error'): check that the previous node returned a body.

  6. Don't hide parse errors with Continue

    With On Error set to Continue (regular output), a parse error returned zero items with a green run and no error field, so the next nodes simply didn't run. Use Continue (using error output) if you want to handle bad XML, or leave it on Stop.

  7. Trim whitespace, handle namespaces

    By default spaces and newlines inside tags are kept (" hello "), which breaks equality checks; Options Trim and Normalize removed them. <a></a> and <b/> gave "", but <c> </c> gave " ". SOAP and other namespaced XML keep prefixes in key names (soap:Envelope, m:Price), so use brackets: {{ $json["soap:Envelope"]["soap:Body"] }}. CDATA was unwrapped to plain text, and a UTF-8 BOM or blank lines before the XML declaration were fine.

  8. JSON to XML: root, attributes and one document per item

    JSON to XML used root as the root element and repeated the tag for arrays (<tags>a</tags><tags>b</tags>). A single top-level key became the root itself. Root Name and Headless set your own root and remove the <?xml?> line. A $ key becomes attributes and _ the text. & and < were escaped (or wrapped with the CDATA option). null and "" became empty tags, 0 and false were kept. Each input item became its own XML document, so aggregate first if you need one file. Keys with a space or starting with a digit failed with Invalid character in name, and a round trip lost types: 19.9 came back as "19.9".

What we ran

On 24 October 2026 we ran 39 executions on self-hosted n8n 2.43.7 with n8n execute: Manual Trigger, a Code node with test XML or JSON, optionally Extract From File, the XML node (v1, the only version), optionally Split Out, and a Code node that recorded the output.

SetupResult
Binary .xml file straight into the XML nodeError: Item has no JSON property called "data"
Extract From File (Extract From XML), then XML nodeParsed fine
HTTP response in a field named body, Property Name left at dataError: Item has no JSON property called "data"
Same, Property Name set to bodyParsed fine
Default options, 2 <item> elementsitem is an array of 2 objects
Default options, 1 <item> elementitem is a plain object, not an array
Split Out on rss.channel.item, 2 items2 correct items
Split Out on rss.channel.item, 1 item3 junk items: the object's fields split apart
Explicit Array onEvery value wrapped in an array, even ["Shop"]
Attribute currency="EUR" on <price>19.90</price>{"_":"19.90","currency":"EUR"}
Merge Attributes offAttributes under $
Ignore Attributes onAttributes dropped, price is plain "19.90"
Explicit Root offOuter rss key removed
Numbers such as 0042 and 19.90Strings: "0042", "19.90"
Normalize Tags onNames lowercased: ItemName becomes itemname
HTML with <br>Error: Unexpected close tag
A JSON stringError: Non-whitespace before first tag. (Char: {)
An object field instead of a stringSame error, Char: [ (it became [object Object])
Bare & as in Tom & JerryError: Invalid character in entity name
Truncated XMLError: Unclosed root tag
Empty stringError: Cannot read properties of null (reading '$error')
Parse error with On Error set to Continue0 items, green run, no error field
Spaces and newlines inside tags, default optionsKept: " hello "
Trim and Normalize onWhitespace removed
<a></a>, <b/>, <c> </c>"", "", " "
SOAP envelope with namespacesKeys like soap:Envelope and m:Price, plus xmlns:* keys
CDATA sectionPlain text, CDATA removed
UTF-8 BOM or blank lines before <?xmlParsed fine
ISO-8859-1 file through Extract From FileCafé came out correct
JSON to XML, defaultRoot element root, arrays repeat the tag
JSON to XML, one top-level keyThat key becomes the root element
Root Name order + HeadlessNo <?xml?> line
$ key and _ keyAttributes and element text
& and < in valuesEscaped; CDATA option wraps them instead
null and ""; 0 and falseEmpty tags <a/>; kept as 0 and false
2 input items2 separate XML documents, not one
Key with a space or starting with a digitError: Invalid character in name
Round trip JSON to XML to JSON19.9 became "19.9", a one-element array became a string

Good to know

What we didn't test

FAQ

Why does the n8n XML node say Item has no JSON property called "data"?

The XML node reads a text field named in Property Name, data by default. You either sent it a binary file (add Extract From File, Extract From XML, first) or your XML is in another field such as body, so set Property Name to that field.

Why does Split Out break when my XML has only one item?

With default options one element becomes an object, not an array, so Split Out splits its fields. Turn on Explicit Array in the XML node options, or wrap the field in an expression with [].concat().

What does "Non-whitespace before first tag" mean in n8n?

The input doesn't start with an XML tag. In our runs it was a JSON string (Char: {) or an object field that became [object Object] (Char: [). If the API returns JSON, skip the XML node.

Why is my XML value an object with an underscore in n8n?

The element has attributes. Its text goes under _ and the attributes become keys, so use $json.price._ or turn on Ignore Attributes.

Why are numbers strings after the n8n XML node?

XML has no types, so every value is a string, and leading zeros are kept. Convert with Number() or Edit Fields before comparing.

How do I make one XML file from many items in n8n?

JSON to XML turns each item into its own document. Combine the items first with Aggregate or a Code node, then convert once.

Related guides

New guides

Still stuck on your n8n error?

Paste the exact error and say what the workflow should do. We reproduce it on a real n8n install and email you the fix or a working workflow, usually within 24h. Free while we're in beta.

We'll only email you about your error and TaskToAgent.