Question

What is the actual difference between Parsing and Validation? As parsing itself can recognise the message structure ,why should we go for validation?

Parsing itself throws error if the message is not as per the structure defined for MRM parser,then why validation property has to be set with "content and value"?

Était-ce utile?

La solution

Firstly only parsers with a message model can validate, so that is XMLNSC/SOAP (with a schema), MRM, DFDL and DataObject.

For XMLNSC based parsers without validation the message will be treated as self defined and an exception will be thrown only if the message is not well formed.

With validation enabled XMLNSC based parsers will validate that the message adheres to the emssage model and will check all restrictions / schema facets defined in the schema for validity.

The DFDL and MRM are model based parsers, there is no way to use these parsers without a message model so they always check the message content against the model. A non-validating parse with these parsers have stronger constraints than an XMLNSC based parser. With validation disabled these parsers check that the data can be interpreted as an instance of the model.

When validating the MRM and DFDL parsers will additionally check value constraints, correct data is of the correct type and check ordering constraints.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top