XMLPorts and Elements

Hi, I just created my first XMLPort and it works pretty good. However, I have one question that I wasn’t able to find elsewhere here in the forum. My XML file looks like this: test test test test test test If I now only want to import field1 with my dataport, do I still have to define the other two fields as well? If I do this, the xmlport works and if I don’t I get a error saying unexpected element. I thought one advantage with xml files was that you didn’t have to care if the sender of the file added in new fields, but it seems that if they do, the import will fail? Thanks Daniel

I think that you have it correct. You determine if an element is required or not by setting properties on the dataport element. The sender of a file can send additional data as long as the element names are not in your XMLPort then the XMPPort ignores the extra data.

Hi David, I have tried all the properties I could find, but I can’t get it to skip elements in the file that I haven’t in my xmlport. The xmlport I have looks like this: dataroot Element Text Sources Element Table Item Field1 Element Field No. The file contains Field2 and field3 as well. When I do an import I get a error message saying Field2 is an unexpected element. If I add Field 2 and 3 to the xmlport, then it works. So it looks like the xmlport need all the fields in the xml file assigned. Do you know which property I have to set in order to get around this? Thank you Daniel