Author |
Message
|
Rahul999 |
Posted: Tue Feb 23, 2010 7:20 am Post subject: Generating CDATA in output message using mapping/compute nod |
|
|
 Centurion
Joined: 14 Mar 2007 Posts: 134
|
Hello,
I have a task in which I need to generate an XML message with CDATA, the structure of the message is given here, I am using the mapping node to map the contents of source XML(which doesnt have any field which might require CDATA) to target XML(which is having a tag consistes of CDATA). The Genereated output message will have and tag which is having CDATA as the element. Now, how I generate the XML so that contents of tag (Address) is CDATA.
Quote: |
<Client>
<Name>
<Type>
<MsgType>REQUEST</MsgType>
<SourceAppl>XYZ</SourceApplFunc>
<SentDate>2010-01-27T03:21:49</SentDate>
</Type>
</Name>
<Address><![CDATA[HouseNo=002|
StreetNo=90465|]]></Address>
</Client> |
Thanks _________________ "For all your days be prepared, and meet them ever alike.
When you are the anvil, bear - when you are the hammer, strike."
- Edwin Markham |
|
Back to top |
|
 |
Rahul999 |
Posted: Tue Feb 23, 2010 8:53 am Post subject: |
|
|
 Centurion
Joined: 14 Mar 2007 Posts: 134
|
Hi All,
Can anyone suggest anything, please. Its kinda urgent, most of the topics in the form is about reading CDATA but none is about generating it.
Thanks _________________ "For all your days be prepared, and meet them ever alike.
When you are the anvil, bear - when you are the hammer, strike."
- Edwin Markham |
|
Back to top |
|
 |
Vitor |
Posted: Tue Feb 23, 2010 9:03 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Rahul999 wrote: |
Can anyone suggest anything, please. |
Not me. I know how to do this in ESQL, but I don't use the mapping node enough to really comment.
Rahul999 wrote: |
Its kinda urgent, most of the topics in the form is about reading CDATA but none is about generating it. |
Then you should be raising a PMR. IBM will give you urgent support as part of the license, we're just a bunch of volunteers with days jobs.
Though I accept some people's day jobs are responding to PMRs.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Feb 23, 2010 9:06 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
|
Back to top |
|
 |
Rahul999 |
Posted: Tue Feb 23, 2010 9:23 pm Post subject: |
|
|
 Centurion
Joined: 14 Mar 2007 Posts: 134
|
Quote: |
http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/topic/com.ibm.etools.mft.doc/ar25650_.htm
|
Thanks Jeff, I managed to resolve it with the link mentioned by you.
But, now going further(while building the reply) I need to take an tag with CDATA elements and generate a XML message tags with each field in CDATA.
Something like -
Quote: |
<MWMB><![CDATA[CLIENT_COUNTRY=IN
CLIENT_STATUS=0
CLIENT_TYPE=9
CLIENT_JOINING_DATE=100696
ADDRESS1=TO BE COLLECTED
ADDRESS2=BARHOUSE
ADDRESS3=
ADDRESS_CONTACT_NAME=INDIA
ADDRESS_IND=0
ADDRESS_SEQ_NUMBER=0
ATM_CLASS=0
]]></MWMB> |
Now I have to take individual fields(CLIENT_COUNTR, CLIENT_STATUS,CLIENT_TYPE etc.) in the above CDATA element and generate the xml tags with them with the value added.
So my output would look like something.
Quote: |
MWMB>
<CLIENT_COUNTRY>IN</CLIENT_COUNTRY>
<CLIENT_STATUS>0</CLIENT_STATUS>
<CLIENT_TYPE>9</CLIENT_TYPE>
...
...
..
and so on. |
Can you please suggest how I go about it.
Thanks _________________ "For all your days be prepared, and meet them ever alike.
When you are the anvil, bear - when you are the hammer, strike."
- Edwin Markham |
|
Back to top |
|
 |
kimbert |
Posted: Wed Feb 24, 2010 2:07 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
So you need to parse a document consisting of lines of text. Each line consists of a tag, a Tag Data Separator ( = ) and a value. Sounds like you need the MRM parser with a TDS physical format.
btw, this question is not really about CDATA. You should really have started a new thread. |
|
Back to top |
|
 |
Rahul999 |
Posted: Wed Feb 24, 2010 4:29 pm Post subject: |
|
|
 Centurion
Joined: 14 Mar 2007 Posts: 134
|
Quote: |
PostPosted: Wed Feb 24, 2010 2:07 am Post subject:
So you need to parse a document consisting of lines of text. Each line consists of a tag, a Tag Data Separator ( = ) and a value. Sounds like you need the MRM parser with a TDS physical format. |
Thanks Kimbert.
What I understand here is that I need to first remove the TAG and CDATA section from the below message and get the remaining part in a string, and then construct a TDS message set with delimiter as '=' so that it will parse all the individual fields?
Quote: |
<MWMB><![CDATA[CLIENT_COUNTRY=IN
CLIENT_STATUS=0
CLIENT_TYPE=9
CLIENT_JOINING_DATE=100696
ADDRESS1=TO BE COLLECTED
ADDRESS2=BARHOUSE
ADDRESS3=
ADDRESS_CONTACT_NAME=INDIA
ADDRESS_IND=0
ADDRESS_SEQ_NUMBER=0
ATM_CLASS=0
]]></MWMB> |
_________________ "For all your days be prepared, and meet them ever alike.
When you are the anvil, bear - when you are the hammer, strike."
- Edwin Markham |
|
Back to top |
|
 |
kimbert |
Posted: Thu Feb 25, 2010 1:00 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
No. You need to
- parse the XML document using the XMLNSC parser
- retrieve the text value of the <MWMB> tag
- pass that text value to the MRM parser. You can do that using CREATE...PARSE...DOMAIN 'MRM'. There are many examples in this forum which you can find using the search button. |
|
Back to top |
|
 |
|