WHo can Help me.
I've wrote an XML Port.
When I Try to import an XML File through that Dataport I receivean error message
The Element <DocumentReference> is expected ba the Min. Accours Value : Once
Element received <Partnerdesription
In this XML Port are more then 1 DocumentReference TagNames.
The Properties are MinOccurs:Once MaxOccurs:Unbounded
I think the error comes from elements with the same Tagname?
I got the XML Port Working by setting the MinOccurs to ZERO but then the Value would not be imported into a table.
Who is so Smart that he could Help me. ](*,)
0
Comments
- <DocumentReference type="SalesOrder">
<DocumentNumber>1005978158</DocumentNumber>
<DateStamp>20070504</DateStamp>
</DocumentReference>
- <DocumentReference type="PurchaseOrder">
<DocumentNumber>BESF10122</DocumentNumber>
</DocumentReference>
If you set up an element in an XMLPort with minoccurs = 1 and a certain name, then the XMLPort will think something is wrong when that element doesn't occur in your XML document. So, you can set MinOccurs to 0, and that should take care of it.
RIS Plus, LLC
RIS Plus, LLC
Hi DenSter,
Yes it's just a piece of code.
The Problem I have is that a suplier gives us the definition of the XML File where thos TagNames are given. Further on in the XML File are some more Tagnames which are more times in the same File.
To set the MinOccurs to ZERO works but NO data will be received ??
RIS Plus, LLC
:shock:
Off course , I did that before but my problem is that No values will be transferred over, allthough the values are there ?
The issue you seem to have is that you have an element with the same name as a sub-element of an element with the same name. That is not wellformed XML. See if you can work with your vendor to modify the design of the XML.
RIS Plus, LLC
RIS Plus, LLC
The main Proble is that the Vendor has allready with other Systems (SAP etc.) interfaces and does not want to change their design.
I Totally aggree that it's not wellformed XML but I have to try to work with it
See if you can find a little program called XML Notepad, it should be on Microsoft.com somewhere. Load your XML in there and you can see the structure. Then you adjust the structure of your XMLPort to comply with it and you should be fine. Note that you will need to manipulate some of the elements with MinOccurs and MaxOccurs because they repeat, and you will need to create attribute nodes to be able to read the values in there. I'd do it for you, but I'd have to charge you for it
RIS Plus, LLC
RIS Plus, LLC
I did create the XML Port and it works if I set of various doubled TagNames the MinOccurs to ZERO or 0, But then Navision won't import alll that data. It will write the LAST Value of the Same TAGNAME (of the SUB) and writes it to the Field of the first TagName. The other Fields (attached to the Tagnames with th esame TagName) will be empty???
Do you have a solution ?
I can send you the XML File, Port and 2 Tables if needed. They's not well Named but for Tests they are okay.
Create the DocumentReference element once, and allow it to repeat itself (hint: maxoccurs). Add the attribute elements indented to that element. Set the minoccurs and maxoccurs to the appropriate values and you should be fine.
RIS Plus, LLC
I have to create and link more tables but I think that that's the only way
Dear DenSter,
For the DocumentReferences it works fine but for the ProductNumber type??
These ar on the same level as the other StatusOverviews.
How does the XMl Port handle them if I only put 1 TagName inside it. (It probably will take the last value (Buyer) in this case.
Is it possible to write between each ProductNumer (READ and WRITE , to write some Code?)