Flat file schema is failing for blank spaces in the input data

yaminajabeen 21 Reputation points
2021-12-07T11:27:51.663+00:00

i have created a flat file having both delimited and positional records, in which it inludes one header, one trailer few records in between them.

please find the sample schema:

but wen we are passing data with blank value between header and trailer it throws an error:

Invoking component...
C:\Users\xedbyj\Downloads\SampleFilePuegoet\BPSOPE_2021-11-20T080031 - Copy.txt: error BEC2004: Unexpected data found while looking for:
'D630'
'D640'
'D660'
'\n'
'9999'
'D570'
'D590'
'D620'
The current definition being parsed is Modelldata_Peugeot_BPSDATA. The stream offset where the error occured is 83. The line number where the error occured is 2. The column where the error occured is 0.
D:\Yamina\BOSAPI\BizTalk\BOS.Peugeot\D0FG008_Peugeot_Modelldata\Schemas\D0FG008-Modelldata_Peugeot.xsd: error BEC2004: Validate Instance failed for schema D0FG008-Modelldata_Peugeot.xsd, file: <file:///C:\Users\xedbyj\Downloads\SampleFilePuegoet\BPSOPE_2021-11-20T080031 - Copy.txt>.
Component invocation succeeded.

155600-schmeas.txt155637-testdata.txt

Microsoft BizTalk Server
Microsoft BizTalk Server
A family of Microsoft server products that support large-scale implementation management of enterprise application integration processes.
349 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,161 questions
{count} votes

Accepted answer
  1. Colin Dijkgraaf 1,346 Reputation points
    2021-12-07T20:31:45.24+00:00

    The problem is that you have defined the Child Delimiter as 0x0A but the file contains CR LF, so your child delimiter (at least on the root node) needs to be 0x0D 0x0A

    With that change, it parses it to below

    <Modelldata_Peugeot_BPSDATA xmlns="http://D0FG008-Modelldata_Peugeot"><Header xmlns=""><RECORD_KODE>0000</RECORD_KODE><MOTTAKER_LAND>004697V IMPOR2YSGA ICUBE</MOTTAKER_LAND><LOPENR>01106</LOPENR><SENDT_DATO>20211120</SENDT_DATO><Filler></Filler></Header><Body xmlns=""></Body><Footer xmlns=""><RECORD_KODE>9999</RECORD_KODE><MOTTAKER_LAND>004697V IMPOR2YSGA ICUBE 01106</MOTTAKER_LAND><ANTALL_RECORDER>00012211</ANTALL_RECORDER><FILLER></FILLER><FILLER1></FILLER1></Footer></Modelldata_Peugeot_BPSDATA>

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. yaminajabeen 21 Reputation points
    2021-12-09T11:57:29.637+00:00
    0 comments No comments