cancel
Showing results for 
Search instead for 
Did you mean: 

Message Mapping - Flat structure to more complex structure

Former Member
0 Kudos

Hi,

Whats the best approach to map from

<resultset>

<row>

<CONTENTS>H1xxx</CONTENTS>

</row>

<row>

<CONTENTS>P1-1xxx</CONTENTS>

</row>

<row>

<CONTENTS>P1-2xxx</CONTENTS>

</row>

<row>

<CONTENTS>H2xxx</CONTENTS>

</row>

<row>

<CONTENTS>P2-1xxx</CONTENTS>

</row>

</resultset>

to

<Payment>

<header>

<CONTENTS>H1xxx</CONTENTS>

</header>

<items>

<CONTENTS>P1-1xxx</CONTENTS>

<CONTENTS>P1-2xxx</CONTENTS>

</items>

</Payment>

<Payment>

<header>

<CONTENTS>H2xxx</CONTENTS>

</header>

<items>

<CONTENTS>P2-1xxx</CONTENTS>

</items>

</Payment>

i.e. map Contents to header if it starts with H, to item if it starts with P

Payment consists of one header plus the items that follow it.

I can't seem to get the contexts in the target message correct

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Shawn!

have you looked at the "SplitByValue" in Context options - use Value Change.

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks for all responses.

Hi Baz!

Yes, I've looked at SplitByValue, could never get exactly what I wanted though.

Praveen, I'll give XSLT a go then.

Stefan, Unfortunately the source message is coming through the JDBC not the file adapter. I agree, a file would be much easier to handle with the advantage of the FCC options

Former Member
0 Kudos

you'll have to go down the XSLT route then!

i used this blog when i could not get the context exactly right in the graphical mapping....

/people/dirk.roeckmann/blog/2006/07/26/grouping-xml-with-xslt--from-muenchian-method-to-xslt-20

stefan_grube
Active Contributor
0 Kudos

> I can't seem to get the contexts in the target message correct

That is right. It is almost impossible with graphical mapping. You can use high sophisticated UFD, but if you have FCC in file adapter, you better go for complex structure with header and item.

former_member181985
Active Contributor
0 Kudos

Use XSLT mapping.