Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How to solve unclosed literal string error in XML documents

(0) ShareShare
ReportReport
Posted on by 25

Greetings again.

Found myself with another sticky issue.

In our Testing environment we ran several invoicing tests, however, if I move from one invoice to another in the electronic invoice journal I get the following error:

"There is an unclosed literal string. Line 1, position 961."

Literal-Strings.jpg

I researched extensively that error, and came to understand that it refers to a string literal which has not been closed in the XML document. Hence, I opened an invoice XML sample and began to manually observe both the contents and structure within the file to seek for any of the following:

  1. Missing double quotes at the end of each string literal

  2. Multiline strings that are not concatenated properly

  3. Or, unescaped double quotes inside each string literal

So far I was not able to identify any missing double quotes, improperly concatenated strings, and/or unescaped double quotes in the XML document.

The error indicates where the possible, faulty literal string is located, but I need to know how to interpret it. 

Or, providing other solutions to that problem.

Please, your help would be mostly appreciated.

  • Suggested answer
    GuidoMTY Profile Picture
    25 on at
    RE: How to solve unclosed literal string error in XML documents

    Found a solution.

    I identified the response that receives the XML document, and then look into its extended datatype.

    The EDT corresponded to EInvoiceCFDIResponse_MX and looked into its properties.

    Found that StringSize's original value for the EDT was 960, so I modified its StringSize property to Memo value in order to increase the response so that the error will not show up again.

    EDT_5F00_properties.jpg

  • Verified answer
    Martin Dráb Profile Picture
    232,866 Most Valuable Professional on at
    RE: How to solve unclosed literal string error in XML documents

    The error message says that the problem was noticed at position 961, therefore look at what you have as the 961st character and at the preceding characters.

    Also note that XML editors with syntax highlighting (such as Visual Studio) can show you syntax errors.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,095 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,866 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans