XML Import

akasererakaserer Member Posts: 6
I created an XMLport and exported some data which is fine.

After that i tried to import this XML file via the same XMLport back into Navision.

I get the following error message:

The XML Parser return the following fatal error:
A document must contain exactly one root element.

Line Number = 1 Column Number = 0

I imported the same file which was exported before with the same XMLport.

How to fix this problem?

Thanks for your help


  • kinekine Member Posts: 12,562
    May be that in your XMLPort you defined the root as something, which is repeated (table)... you need to have only one root, not for example 10 items...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • akasererakaserer Member Posts: 6
    I use the standard Navision 4.0 Cronus US database and in here i use the pre-defined dataport

    ID 10 - IC G/L Account Import/Export

    <?xml version="1.0" encoding="UTF-16" standalone="no"?>
    <ICGLAccount No="10000" Name="ASSETS" AccountType="Begin-Total" IncomeBalance="Balance Sheet" Blocked="No" Indentation="0"/>
    .... (there are more elements like this)

    So you see: there is only 1 GLAccounts root node.

    The export works, but i got the problem with the import.

    I use this one just for testing but i need to import other XML docs to Navision.

  • pduckpduck Member Posts: 147
    maybe somewhere is an element / attribute which is named like the root element ? try using a namespace if possible.
  • ara3nara3n Member Posts: 9,255

    This is a known issue and here is the KB article

    https://mbs.microsoft.com/knowledgebase ... -us;946445
    Ahmed Rashed Amini
    Independent Consultant/Developer

    blog: https://dynamicsuser.net/nav/b/ara3n
Sign In or Register to comment.