|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Mapping default values |
« View previous topic :: View next topic » |
Author |
Message
|
francoisvdm |
Posted: Wed Sep 10, 2008 12:13 am Post subject: Mapping default values |
|
|
Partisan
Joined: 09 Aug 2001 Posts: 332
|
Hi, MB V6.0.2 on windows
Input XML is:
<Record>
<Name>Francois</Name>
<Item>
<Line1>Some data</Line1>
<Line2>more data</Line2>
</Item>
</Record>
The output must always have 10 Items, requirement from endpoint system, silly yes, I know, but that is the current situation.
So, what must I do in message set and mapping to ensure my output looks like:
<Record>
<Name>Francois</Name>
<Item>
<Line1>Some data</Line1>
<Line2>more data</Line2>
</Item>
<Item>
<Line1>NULL</Line1>
<Line2>NULL</Line2>
</Item>
.
.
<Item> -- 10th instance
<Line1>NULL</Line1>
<Line2>NULL</Line2>
</Item>
</Record>
Thank you _________________ If you do not know the answer or you get the urge to answer with "RTFM" or "Search better in this forum", please refrain from doing so, just move on to the next question. Much appreciated.
Francois van der Merwe |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Sep 10, 2008 2:07 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Don't know if you use mapping node or ESQL.
For ESQL use:
For your nth occurrence n <= 10 ....
Create lastchild of RecordRef as ItemRef Name 'Item';
Create lastchild of ItemRef Name 'Line1' Value Null;
Create lastchild of ItemRef Name 'Line2' Value Null;
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
francoisvdm |
Posted: Wed Sep 10, 2008 1:12 pm Post subject: |
|
|
Partisan
Joined: 09 Aug 2001 Posts: 332
|
want to use mapping node if possible....but can't get it to tick  _________________ If you do not know the answer or you get the urge to answer with "RTFM" or "Search better in this forum", please refrain from doing so, just move on to the next question. Much appreciated.
Francois van der Merwe |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Sep 10, 2008 1:44 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Should be able to create a for loop 1..10, and map to the indexed target with a COALESCE style source. |
|
Back to top |
|
 |
francoisvdm |
Posted: Wed Sep 10, 2008 11:41 pm Post subject: |
|
|
Partisan
Joined: 09 Aug 2001 Posts: 332
|
Very good idea, thanks _________________ If you do not know the answer or you get the urge to answer with "RTFM" or "Search better in this forum", please refrain from doing so, just move on to the next question. Much appreciated.
Francois van der Merwe |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|