|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
String data to XML format |
« View previous topic :: View next topic » |
Author |
Message
|
nishantmodak |
Posted: Tue Jun 16, 2009 11:28 am Post subject: String data to XML format |
|
|
Novice
Joined: 25 May 2009 Posts: 19
|
I receive a response message from HTTP Request. THen, SOAP Extract.
The response is of type --
<saveResponse>
<result> [[[this is a string data, which is actually another XML]]]]] </result>
</saveResponse>
Now, this response needs to be understood. and then the [[[.... ]]]] part needs to be converted into an XML and then spitted to a output queue.
Example. The parsed Tree in Debug mode, looks like this.[after soap extract]
XMLNSC
saveResponse
response = " <?xml ...... " (DATA THAT NEEDS TO BE CONVERTED AS XML) |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jun 16, 2009 1:32 pm Post subject: Re: String data to XML format |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
nishantmodak wrote: |
Now, this response needs to be understood. and then the [[[.... ]]]] part needs to be converted into an XML and then spitted to a output queue. |
Sounds like you need to PARSE this string. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
nishantmodak |
Posted: Wed Jun 17, 2009 3:19 am Post subject: |
|
|
Novice
Joined: 25 May 2009 Posts: 19
|
yeah. Parse = true... but, this being a variable length string response....
a bit of a challenge on how to do it, with changing tags.
Any way out of doing this? any smarter ways to do it? using schema's or any built in parsers? |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jun 17, 2009 3:43 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
nishantmodak wrote: |
yeah. Parse = true... but, this being a variable length string response... |
I've never heard of fixed length XML, or XML with a length indicator. I don't see this being variable length as a serious problem.
nishantmodak wrote: |
a bit of a challenge on how to do it, with changing tags. |
XML is essentially self describing. If you need to validate it against a schema, I'd convert it in one step and validate it in the second. Obviously if it doesn't parse as well formed XML you can trap the error.
nishantmodak wrote: |
Any way out of doing this? any smarter ways to do it? using schema's or any built in parsers? |
Do what? You're parsing a string into XML. How much smarter do you want? Given your solution currently has one XML doc inside another, which is never especially good, all you're going to do is extract it and parse it. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Jun 17, 2009 4:32 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
nishantmodak wrote: |
a bit of a challenge on how to do it, with changing tags.
Any way out of doing this? any smarter ways to do it? using schema's or any built in parsers? |
Why ever do you think you need to construct an XML Parser in ESQL?
You can do everything you want with one single ESQL statement. Finding out which statement is *incredibly* easy. |
|
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
|
|
|
|