Posted: Tue Apr 18, 2006 11:46 pm Post subject: XML structure validation against a schema
Voyager
Joined: 05 May 2003 Posts: 98
I'm trying to explore what happens when we have different versions of a given XML message passing between flows.
I have created an MRM message set from a given version of the schema. A flow is specifying that message on the input node. Validation is turned off on the input node.
If I then hack the XML message going into that flow by adding a few more fields (that will by definition not appear in the message set - but is still well formed) I was expecting the flow to throw a ParserException - but it doesn't.
If I turn validation on it does but I was expecting the structure to be validated even with validation turned off - as it does for CWF message. Is this the expected behaviour?
If I turn validation on it does but I was expecting the structure to be validated even with validation turned off - as it does for CWF message. Is this the expected behaviour?
Of course. It would be rather unhelpful for the XML parser to validate against the message set regardless of the validation switch!
MRM parsers throw two kinds of exception - parsing exceptions and validation exceptions. Validation exceptions are only ever thrown when validation is enabled.
The CWF parser is not doing validation - it throws a parsing exception when it cannot possibly parse the incoming message. The XML parser follows the same rule. If you give it a badly-formed XML document it throws a parsing exception.
You tend to get more parsing exceptions from CWF than from XML because XML is a very easy language to parse.
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