cancel
Showing results for 
Search instead for 
Did you mean: 

File Content Conversion : Sender Channel

Former Member
0 Kudos

Hi

I am trying to do content conversion in the Sender Channel from a flat file to a XML.

My Target XML(message structure) looks like

<H1>

<H2>

<D>Detail Record</D>

<L1>line</L1>

<L1>line</L1>

</H2>

<H2>

<D>Detail Record</D>

<L1>line</L1>

<L1>line</L1>

</H2>

</H1>

Here the element <H2> is only needed to group <D> and the following <L1> elements of each new occurrence of <D>.

Now my problem is that the element <H2> is not getting created.

and the message after content conversion is looking as follows

<H1>

<D>Detail Record</D>

<L1>line</L1>

<L1>line</L1>

<D>Detail Record</D>

<L1>line</L1>

<L1>line</L1>

</H1>

What should I do to get the desired result.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Can you mention what are all the content conversion parameteres that you you entered in you rcommunication channel, here?

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Content conversion is allowed only upto 3 levels and hence, that might be the reason that you are not getting the desired structure.

If <h2> segment is not all that important, you could use the structure that is being generated now, and map this to the target, with constants for <h2> tag in the target.

Regards,

Smitha.

Former Member
0 Kudos

@Yes Bhavesh you are right.

Hi Jai,

I am trying the other way round.i.e from flat file to a XML message.As I said I was trying to do it for Sender Channel where is the after content conversion I want a XML file.The example is a what I framed out of my actual problem.

if flat file is as follows ,

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

DetailRecord1

Line1

Line2

Line3

DetailRecord2

Line4

Line5

then the XML must look like

<H1>

<H2>

<D>DetailRecord1</D>

<L1>Line1</L1>

<L1>Line2</L1>

<L1>Line3</L1>

</H2>

<H2>

<D>DetailRecord2</D>

<L1>Line4</L1>

<L1>Line5</L1>

</H2>

</H1>

I identify the different types records in the flat file

as follows,

Record starting with "Detail" is considered as <D> element

Record starting with "Line" is considered as <L> element.

Hope I did clarify.

Former Member
0 Kudos

Sudip,

Upto my knowledge, using file content conversion you can get only one level hieracrchy ie

<H1>

<D>Detail Record1</D>

<D>Detail Record2</D>

</H1>

<H2>

<L1>Line1</L1>

<L1>Line2</L1>

<L1>Line3</L1>

<L1>Line4</L1>

<L1>Line5</L1>

</H2>

This is possible.

Do the content conversion like this and use JAVA mapping to group the Detail record and all its corresponding Line records.

Any way, let us wait for others to comment on this...

Regards,

Jai Shankar.

Former Member
0 Kudos

Try mapping <H2> to an empty constant.

Regards,

Jai Shankar

Former Member
0 Kudos

Hi Jai,

Thanks for your answer.But the problem is not in the mapping,but before that in the content conversion .I may be wrong in saying the target XMl message,but what I meant was the target message for the content conversion not the mapping.From mapping point of view this is the source message this is the source message.So correction needed is in the content conversion.maybe i am missing something.

bhavesh_kantilal
Active Contributor
0 Kudos

Sudip,

Can you pass us your content conversion parameters and the source file ?

Regards,

bhavesh

Former Member
0 Kudos

COntent conversion?? After content conversion do you want the XML file?? If you need the output in XML format you have to avoid content conversion in your receiver communication channel. If you use content conversion, you will get a flat file.

@Bhavesh, What is that I am missing here? It seems I have not got the issue correctly..

Regards,

Jai Shankar.

bhavesh_kantilal
Active Contributor
0 Kudos

Jai,

He is using Content Conversion in the Sender File adapter to convert the text File into an XML file.

The XML given above is his Source XML and not the Target XML and that is why the confusion.

Regards,

Bhavesh