ANS-1417 · PRINTING, PDF & EMAIL TEMPLATES

How to Resolve NetSuite XML Parser Error with Image Tags in HTML?

This article explains how to fix an XML parsing error in NetSuite caused by specific HTML structuring of image tags within table cells.

Short answer

To resolve XML parsing errors related to image tags, remove the `<div>` element that encapsulates an `<img>` tag within a `<td>` element. The NetSuite XML parser does not handle this specific nesting well, leading to parsing failures. Directly placing the `<img>` tag inside the `<td>` resolves the issue, allowing the XML to be parsed correctly.

Scenario

Users may encounter an 'Error Parsing XML: Element type "td" must be followed by either attribute specifications, ">" or "/>"' when NetSuite attempts to parse XML. This specific error arises when an `` tag is structured within a `` element that is itself contained within a `

` element.

Solution

The NetSuite XML parser does not operate well with tags placed inside a element when that is encapsulated within a

. Removing the
element satisfies the XML parser and resolves the error. This modification allows the XML to be parsed without error. Consider the original problematic structure:

<td style="width : 100%;">
    <div id="company-logo-container"><img src="${companyInformation.logo}" align="left" style="padding: 0px; margin: 0px;"/></div>
</td>

The corrected structure, with the

removed, is:

<td style="width : 100%;">
    <img src="${companyInformation.logo}" align="left" style="padding: 0px; margin: 0px;"/>
</td>

Expert NetSuite Support

Need help with this NetSuite issue?

Printing, PDF & Email Templates consulting and configuration support

Talk to a consultant