Author |
Message
|
souciance |
Posted: Fri Mar 22, 2013 11:43 am Post subject: Split xml using blob parser |
|
|
Disciple
Joined: 29 Jun 2010 Posts: 169
|
Hello...
I have a case where a system somehow manages to send two xml messages in a single MQ message. This includes xml declarations and root tag that repeat. As the xmlnsc parser cannot parse this I have to parse it as a blob. Then buffer it and split för every end tag.
Just wondering if people have other solutions they can recommend? |
|
Back to top |
|
 |
lancelotlinc |
Posted: Fri Mar 22, 2013 11:48 am Post subject: Re: Split xml using blob parser |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
souciance wrote: |
a system |
What system?
Can you send back an error to the originating system?
Are you doing SOAP over MQ? _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
adubya |
Posted: Fri Mar 22, 2013 12:21 pm Post subject: |
|
|
Partisan
Joined: 25 Aug 2011 Posts: 377 Location: GU12, UK
|
CAST the BLOB to a char and split on the "<?xml" declaration using SUBSTRING, propagating each substring as an XMLNSC domain msg using some CREATE field PARSE trickery ? ? |
|
Back to top |
|
 |
souciance |
Posted: Fri Mar 22, 2013 12:27 pm Post subject: |
|
|
Disciple
Joined: 29 Jun 2010 Posts: 169
|
Yeah we have sent the error but they want us to handle it somehow... |
|
Back to top |
|
 |
lancelotlinc |
Posted: Fri Mar 22, 2013 12:47 pm Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
souciance wrote: |
Yeah we have sent the error but they want us to handle it somehow... |
XML documents need to be well-formed. If you are presented with an XML payload that is not well-formed, the correct action is to return an error. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
kimbert |
Posted: Fri Mar 22, 2013 1:43 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
adubaya's suggestion will work, although it is dependent on the presence of an XML declaration at the start of the second XML message.
I would put the splitting logic into a separate flow - that way, when the originating application gets fixed you can just decommission the splitter flow. |
|
Back to top |
|
 |
|