Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archive)
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
    225,155 Moderator 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 Spotlight of the Month

Kudos to Mohamed Amine Mahmoudi!

Blog subscriptions now enabled!

Follow your favorite blogs

TechTalk: How Dataverse and Microsoft Fabric powers ...

Explore the latest advancements in data export and integration within ...

Leaderboard > Microsoft Dynamics AX (Archive)

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans