|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
XML-TDS converion ESQL question |
« View previous topic :: View next topic » |
Author |
Message
|
Ajju. |
Posted: Fri Nov 15, 2002 1:26 pm Post subject: XML-TDS converion ESQL question |
|
|
 Voyager
Joined: 26 Jul 2002 Posts: 77
|
HI folks,
how is the ESQL syntax for the following example.
INPUT XML :
<QuestionAnswer>
<QuestionCd>5GIG04</QuestionCd>
<Answer>Y</Answer>
<QuestionCd>5GIG05</QuestionCd>
<Answer>N</Answer>
<QuestionCd>5GIG06</QuestionCd>
<Answer>Y</Answer>
</QuestionAnswer>
output should be a TDS format like:
||QuestionCd1:5GIG04||Answer1:Y||
QuestionCd2:5GIG05||Answer2:N||
QuestionCd3:5GIG06||Answer3:Y||
without root elements added to it.
is ESQL the right way or is there anyotherway to do it
Thanks in adv,
Ajju. |
|
Back to top |
|
 |
kirani |
Posted: Sat Nov 16, 2002 10:26 am Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Ajju,
Your output message is in this format:
||TAG1:Value1||TAG2:Value2||TAG3:Value3||
I don't think you can set TAG Names dynamically in TDS. I think you should treat TAG1:Value1 as your tagged data and set your Data Element Separation Method to All Elements Delimited. Use a combination of FIELDNAME function and counter to generate your TAG names from input XML tags. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
Ajju. |
Posted: Mon Nov 18, 2002 6:16 am Post subject: |
|
|
 Voyager
Joined: 26 Jul 2002 Posts: 77
|
Thanks Kiran,
actually as my input XML is
<TAG1>VALUE1</TAG1>
<TAG2>VALUE2</TAG2>
<TAG3>VALUE3</TAG3>
<TAG4>VALUE4</TAG4>
ouput shud be:
actual value of TAG1:value of TAG2||value of TAG3:value of TAG4||
I.e
VALUE1:VALUE2||VALUE3:VALUE4||
Thanks in adv,
Ajju. |
|
Back to top |
|
 |
kirani |
Posted: Thu Nov 21, 2002 2:52 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Ajju,
Create a messageset with following:
1. Define 4 elements to store values from input data.
2. Create 2 compound types. Set Data Element Separation to All Elements Delimited and set Delimiter to :.
3. In first compound type (Comp1), add Element 1 and Element 2, you don't have to set any special property in TDS tabs for these elements.
4. In second compound type (Comp2), add Element 3 & 4.
5. Create third compound type (Comp3) with Data Element Separation to All Elements Delimited, set Delimiter to || and Group Terminator to ||. Make sure Type composition is set to Sequence and Type content to Closed for this compound type. Add Comp1 and Comp2 types to this compound type.
6. Create your output message defn based on third compund type.
In a Compute node map data from your input message to TDS output Message using appropriate ESQL code. This should give you output data into:
ELEM1:ELEM2||ELEM3:ELEM4|| format.
Hope this helps! _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
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
|
|
|
|