Table of Content
HAL Forum
function xml ParseXMLArea (
area TargetArea)
Description:
Will parse the xml data inside the area for later analyze and extraction.
Parameters:
TargetArea The area variable that holds the xml data.
global
updating procedure KrediidiinfoRn(record RcVc RepSpec)
begin
  xml reply;
  Integer res;
  record CUVc CUr;
  record InternetEnablerBlock IEb;
  record ModuleBlock Mb;
  Area a_reply;
  
  BlockLoad(IEb);
  BlockLoad(Mb);
  res = -1;

  CUr.Code = RepSpec.f1;
  if (ReadFIrstMain(CUr,1,true)) then begin end;
  SetFileOnServer(true);
  GetAreaFromFile(a_reply,"tmp\\ki-" & CUr.Code & ".xml");
  Delete_File("tmp\\ki-" & CUr.Code & ".xml");
  SetFileOnServer(false);  
  
  StartReportJob(USetStr(15050));
  EndHeader;
  
  SetRepCol(2,120);
  SetRepCol(3,240);
  SetRepCol(4,360);
  if (GetAreaLength(a_reply)<=1) then begin
    res = -1;
  end else begin
    res = 1;
  end; 
  reply = ParseXMLArea(a_reply);
  
  if (IEb.RegInCountry==0) then begin
    StartFormat(15);
     OutString(0,0,USetStr(20242),false);
    EndFormat;
    goto LKrediidiinfoRn;
  end;

  if (res==-1) then begin
    StartFormat(15);
     OutString(0,"DblCUVc",RepSpec.f1,false);
     OutString(100,0,"no RegNr",false);
    EndFormat;
    goto LKrediidiinfoRn;
  end;
  
  StartFormat(15);
   OutString(0,0,USetStr(2923),false);
  EndFormat;
  switch (IEb.RegInCountry) begin
    case 7:  EstonianCustomerData(reply,res,CUr);
    case 16: EstonianCustomerData(reply,res,CUr);
    case 25: EstonianCustomerData(reply,res,CUr);
    case 3:  SwedishCustomerData(reply,res,CUr);
  end;

  switch (IEb.RegInCountry) begin
    case 3:
    otherwise
      StartFormat(15);
      EndFormat;
      StartFormat(15);
       OutString(0,0,USetStr(15079),false);
      EndFormat;
      StartFormat(15);
       OutString(0,0,USetStr(15080),false);
      EndFormat;
      StartFormat(15);
       OutString(0,0,USetStr(15081),false);
      EndFormat;
  end;
 LKrediidiinfoRn:; 

  EndJob;
  RETURN;
END;

Related topics:
««