cancel
Showing results for 
Search instead for 
Did you mean: 

Sender File Adapter - Content Conversion

Former Member
0 Kudos

HI Friends,

I got a scenario where I need to convert the File to XML document through Sender file adapter..

My file looks like below.

BATCH1234........

12DASER123142JMM

237DSAFDLKC839890

45SDFLASJ90011

BATCH3455...

132FGAR

SD21352525

BATCH998898...

123145DSRTW

12FSTS

So there is a Header and Body for each record set..

My XML Structure is as follows.


<TimeStructure>
  <TimeRecord>
     <ControlRec>
         <Field1>BATCH </Field1>    
         <Field2> ...</Field2>
     </ControlRec>
     <DataRec>
         <F1> ...... </F1>
         <F2> ...... </F2>
     </DataRec>
  </TimeRecord>
  <TimeRecord>
     <ControlRec>
         <Field1> BATCH  </Field1>    
         <Field2> ADFAS  </Field2>
     </ControlRec>
     <DataRec>
         <F1> ...... </F1>
         <F2> ...... </F2>
     </DataRec>
   </TimeRecord>
</TimeStructure>

The blog <a href="/people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem:///people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem

is somewhat relevant to my requirement.

But the problem is I have the keyfield "BATCH" for my header file but don't have any <b>key field in the data record</b> of the input file.

Please help me out how to mention the configuration parameters.

Regards,

Kumar

Accepted Solutions (1)

Accepted Solutions (1)

moorthy
Active Contributor
0 Kudos

Hi,

If you don't have constant key value for your detail records, then you can not directly get the required xml.

So in this case, you can read all the records in a common Row model, i.e each record will be considered as a one row with all the values, and then split this row with Substring or java functions in the mapping.

Even you can do this in the Adapter module .

If you have key value for each record to identify then you can try with content conversion.

Regards,

Moorthy

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Ajai,

If you have multiple recorset structure, you will need key filed value.

Otherwise you keep everything in flat structure and make a deep nested structure in Mapping program.

or use Adapter module to create the desired structure.

Regards,

Satish Chauhan