Author |
Message
|
plewton |
Posted: Mon Mar 15, 2004 7:47 am Post subject: Physically Invalid XML - When does it fail the XML Parser |
|
|
Novice
Joined: 20 May 2003 Posts: 14
|
Hi,
I'm running WBI Msg Broker 5.0.2. I have an MQInput node using the XML Parser to read input XML messages. Both the Failure and Catch terminals of the Input Node are connected to an MQOutput node, bound to an error queue. I have the settings on the Input node to
Validate: Content and Value
Failure Action: Exception
Timing: Immediate
Not all physically invalid XML messages I put on the input queue end up on the error queue as I'd expect.
If I take a valid XML file and delete the end so that it ends half way through an element value then an exception is thrown and the message goes to the error queue.
However, If I take a valid XML file and delete the final bracket or delete the end so that it ends half way through an element name then an exception is NOT thrown and the message goes through without problem.
Why is this? Surely all physically invalid XML should be picked up and sent to the error queue?
Thanks! |
|
Back to top |
|
 |
TonyD |
Posted: Mon Mar 15, 2004 1:52 pm Post subject: |
|
|
Knight
Joined: 15 May 2001 Posts: 540 Location: New Zealand
|
The validation addressed through MQInput node properties only applies against predefined messages. |
|
Back to top |
|
 |
JLRowe |
Posted: Tue Mar 16, 2004 4:09 am Post subject: |
|
|
 Yatiri
Joined: 25 May 2002 Posts: 664 Location: South East London
|
The 'just in time' parsing technique means that if you do not reference an invalid element, or update the message tree (which will cause the whole message to be parsed), it will pass through without an exception. The output message is simply copied from the input bitstream and is not constructed from the message tree.
You can force the parse with a trace node, referencing the last element in a message or by recursively referencing every element in the message. |
|
Back to top |
|
 |
mpuetz |
Posted: Tue Mar 23, 2004 5:31 am Post subject: |
|
|
Centurion
Joined: 05 Jul 2001 Posts: 149 Location: IBM/Central WebSphere Services
|
Hi,
if you specifiy validation - immediate in the input node, the
parser should parse the whole message in the input node.
I have observed the same behavior that WBIMB does not
validate the message bitstream until the end of the
buffer, hence if the final closing XML tag is damaged
WMQI does *not* notice this. Such an XML document
is not even well-formed.
I consider this a bug which should be reported to IBM
support. _________________ Mathias Puetz
IBM/Central WebSphere Services
WebSphere Business Integration Specialist |
|
Back to top |
|
 |
JLRowe |
Posted: Tue Mar 23, 2004 8:00 am Post subject: |
|
|
 Yatiri
Joined: 25 May 2002 Posts: 664 Location: South East London
|
Also remember that the validation mode only applies to MRM domain messages, XML & XMLNS domain messages are validated on a just in time basis.
I do not use the validate options on the input node as my patterns dictate that I catch the error and log it first, validation errors go straight to the failure terminal. I force validation with a recursive procedure that walks every node of the message tree. |
|
Back to top |
|
 |
mpuetz |
Posted: Tue Mar 23, 2004 2:10 pm Post subject: |
|
|
Centurion
Joined: 05 Jul 2001 Posts: 149 Location: IBM/Central WebSphere Services
|
Hi,
true, validation can only be done for MRM defined messages,
but if you choose validation - immediate for XML and XMLNS
you get at least well-formedness checking, and the message
tree is built completely if you leave the input node. _________________ Mathias Puetz
IBM/Central WebSphere Services
WebSphere Business Integration Specialist |
|
Back to top |
|
 |
|