XMLPort xml layout consistency

Roelof
Roelof Member Posts: 377
edited 2012-02-25 in NAV Three Tier
Is there any way to import an xml file in NAV (using RTC) using an XMLPort where the import sometimes has incomplete set of elements. So, for example, the XMLPort structure would be like:

<Navision_Export>
<Element1>
<Attribute1>
<Element2>
<Attribute1>
<Element3>
<Attribute1>
<ELement4>
<Attribute1>

And an xml file comes in, sometimes as:
<?xml version="1.0" encoding="UTF-8"?>
<navision_export>
<Element1 Attribute1="teststring" />
<Element1 Attribute1="teststring" />
<Element2 Attribute1="teststring" />
<Element2 Attribute1="teststring" />
<Element3 Attribute1="teststring" />
<Element3 Attribute1="teststring" />
<Element4 Attribute1="teststring"/>
</navision_export>

or as:
<?xml version="1.0" encoding="UTF-8"?>
<navision_export>
<Element1 Attribute1="teststring" />
<Element1 Attribute1="teststring" />
<Element2 Attribute1="teststring" />
</navision_export>

Currently I'm getting an error in RTC. However in Classic everything works fine.
Roelof de Jonghttp://www.wye.com

Comments

  • kine
    kine Member Posts: 12,562
    How did you set up the MinOccurence property of each element?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Roelof
    Roelof Member Posts: 377
    For Element 'Navision_Export':
    MinOccurence = Once
    MaxOccurence= Unbounced

    For Element 1, 2,3:
    MinOccurence=Zero
    MaxOccurence=Unbounced
    Roelof de Jonghttp://www.wye.com