|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
NOT well formed XML |
« View previous topic :: View next topic » |
Author |
Message
|
x061294 |
Posted: Mon Mar 26, 2007 8:56 am Post subject: NOT well formed XML |
|
|
 Acolyte
Joined: 05 Apr 2005 Posts: 62
|
WBIMB 6.0.0.3 on linux
Everyone/everything in broker always talks about working with well formed XML. That's a good thing. But, how are people verifying that they are receiving well formed xml?
We would like to determine if we have well formed XML before we start to process the data and was wondering what would be the best way to do this. We are not defining our data in the MRM, and I'm not looking to do schema validation. Just want to make run the data through a separate flow/process/node to do that generic service before running it into the business process logic. That way I can deal with it in one place and not worry all my business logic processing to have to check for parsing errors.
Thoughts? Was wondering if ABITSTREAM could help us our, or, run it through an XSLT transforming nothing, etc?
Appreciate any ideas/suggestions. |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Mon Mar 26, 2007 10:59 am Post subject: Re: NOT well formed XML |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
x061294 wrote: |
WBIMB 6.0.0.3 on linux
Everyone/everything in broker always talks about working with well formed XML. That's a good thing. But, how are people verifying that they are receiving well formed xml?
We would like to determine if we have well formed XML before we start to process the data and was wondering what would be the best way to do this. We are not defining our data in the MRM, and I'm not looking to do schema validation. Just want to make run the data through a separate flow/process/node to do that generic service before running it into the business process logic. That way I can deal with it in one place and not worry all my business logic processing to have to check for parsing errors.
Thoughts? Was wondering if ABITSTREAM could help us our, or, run it through an XSLT transforming nothing, etc?
Appreciate any ideas/suggestions. |
If you set domain on MQ Input node broker will check if message is well formed XML or not. If this is well formed XML message is processed. if not message is backout or goes to error terminal (depends on configuration, backout count etc.) _________________ Marcin |
|
Back to top |
|
 |
kimbert |
Posted: Mon Mar 26, 2007 2:22 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
We would like to determine if we have well formed XML before we start to process the data |
That's the wrong approach. The XML parser will not parse your message unless it is well-formed XML. ( and if it did, it would not deserve the name 'XML parser' ).
Just write your message flow to cope with errors ( check this forum and DeveloperWorks for advice about that ). Treat parsing errors as 'just another kind of error'. |
|
Back to top |
|
 |
x061294 |
Posted: Tue Mar 27, 2007 3:38 am Post subject: |
|
|
 Acolyte
Joined: 05 Apr 2005 Posts: 62
|
Appreciate the information kimbert. I was looking for/considering a generic "service" if you will, something I could feed in XML and be sure that it was well formed, taking as you said appropriate action at that time. Since in general MB is an on demand parser, was thinking if there was something I could do that would force a parse through the whole data stream and draw out those errors right away. Wondered what might be the best "tool" for this, if say an XSLT transformation node would be simple, or, if going through a compute node and doing a copy of a field that wasn't there, if I could force MB to search the whole data stream, was wondering if there was a way to get the whole stream in one go.
marcin.kasinski, thanks for the suggestion, but as for XML on the input node, a couple of things. One, I have a generic input node taking in blob because I don't know if it will be xml or not right off the bat. So it limits me a little there. Also, while this does sort of work, it rolls the message to the backout queue unless you code for the parsing errors, which therefore doesn't really solve my problem, just moves it.
Interestingly enough, if you pass in not well formed XML, with XML on the input node, and watch through the debugger, the message actually does get put out on the other side. If you don't have the debugger one, it rolls to the backout queue. So different action depending on if the debugger is watching or not. While you would never have the debugger on for real, it does make investigation of the problem a lot harder when the debugger causes different results than normal processing. |
|
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
|
|
|
|