Author |
Message
|
nagarjun_vv |
Posted: Tue Dec 02, 2008 3:48 am Post subject: unable to convert string to XML!!! |
|
|
Apprentice
Joined: 24 Jun 2008 Posts: 33
|
Hi All,
We got a new requirement of sending a XML message to downstream system in string format.
So i used the function CAST(ASBITSTEAM(InputRoot.XML) AS CHAR CCSID InputRoot.Properties.CharCodedSetId)
Now after receiving the message in string format i am unable to convert it to XML.
Please give some ideas for converting the string to XML.
NOTE: there is no message set for XML.
Every idea will get a smile. Please
Regards,
Nagarjun. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Dec 02, 2008 4:01 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Look up the CREATE command....  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Vitor |
Posted: Tue Dec 02, 2008 4:01 am Post subject: Re: unable to convert string to XML!!! |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
nagarjun_vv wrote: |
Please give some ideas for converting the string to XML. |
I'd try parsesing it. Into an XMLNS or XMLNSC rather than XML.
nagarjun_vv wrote: |
NOTE: there is no message set for XML. |
Gosh - really???  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
AkankshA |
Posted: Tue Dec 02, 2008 4:16 am Post subject: Re: unable to convert string to XML!!! |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
create a new child in env tree and specify the doamin as XML (though we would suggest XMLNSC) _________________ Cheers |
|
Back to top |
|
 |
kimbert |
Posted: Tue Dec 02, 2008 4:22 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Sorry - I do not understand what you are trying to do. Please answer the following questions.
Quote: |
We got a new requirement of sending a XML message to downstream system in string format |
Is there any other way to send XML? What is special about this 'string format'?
Quote: |
i used the function CAST(ASBITSTEAM(InputRoot.XML) AS CHAR CCSID InputRoot.Properties.CharCodedSetId) |
You are writing out the entire XML tree. So why not simply use an output node ( e.g. MQOutput ).
Quote: |
Now after receiving the message in string format i am unable to convert it to XML. |
Two questions here:
1. I thought you were trying to *send* it to a downstream system.
2. What do you mean by 'convert it to XML'? Are you trying to parse it ( i.e. convert it to a message tree)? |
|
Back to top |
|
 |
bhumulas |
Posted: Tue Dec 02, 2008 6:49 am Post subject: |
|
|
Apprentice
Joined: 17 Feb 2006 Posts: 41
|
CREATE LASTCHILD of Environment.Variables.MyXML DOMAIN('XML') PARSE(inputstring);
Try something like this |
|
Back to top |
|
 |
nagarjun_vv |
Posted: Wed Dec 03, 2008 9:01 am Post subject: Thanks its worked |
|
|
Apprentice
Joined: 24 Jun 2008 Posts: 33
|
Thanks everyone i am very happy by seeing your quick responses thanks a lot.  |
|
Back to top |
|
 |
kimbert |
Posted: Wed Dec 03, 2008 10:50 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Please do not use this code:
Code: |
CREATE LASTCHILD of Environment.Variables.MyXML DOMAIN('XML') PARSE(inputstring); |
You should be using XMLNSC or XMLNS:
Code: |
CREATE LASTCHILD of Environment.Variables.MyXML DOMAIN('XMLNSC') PARSE(inputstring CCSID myCCSID Encoding myEncoding); |
|
|
Back to top |
|
 |
|