Options

xmlport.skip problem that exits port when there is more lines to read?

BlankNameBlankName Member Posts: 20
Hello colleagues. When using xmlport.import function I get problem where I use this code to skip first line which works great on all other files, but I find one file which is in structure 100% same as all other files, but it won't import.

When running debugger xmlport.skip function returns from XMLPORT window to my main codeunit and then goes
back in for next data item in XMLPORT, but not with this file it returns from XMLPORT and does not go back in it(all files are identical and there is more data after first line). All my important lines after first line is somehow ignored. And my import is in try function which should capture any error, but none is captured. If I put my statement like this IF xmlport.import THEN do smth. It still says xmlport.import was true and it was successful when in reality it executed first line and then exited my streamed file for good.

I'm doing a lot of imports 100 plus files and trying to keep track of what's imported and not, but with this file I have doubts about XMLPORT importing trustworthiness. Anyone have any ideas what is happening and why? It works great with other files as far as I have seen, but one file just gets ignored after first line. How could I capture this error?
IF Lines = 0 THEN BEGIN
   Lines+=1;
   currXMLport.SKIP;
END;

Answers

  • Options
    BlankNameBlankName Member Posts: 20
    Okey I rewrote my logic in xmlport that I wouldn't use xmlport.skip and it just executes first line in file and then its done, when there is more lines to read.
  • Options
    BlankNameBlankName Member Posts: 20
    1. csv file format all files are same format. 2. With this design everything works fine only problem occurs with one file which looks the same outside and inside. 3. minoccurs= zero max= unbound.

    My guess is that something is wrong with file, but it looks the same as all files in structure and data types that goes in everything is the same.
Sign In or Register to comment.