Schematron provides another means of validating the message payload of a web service. It takes a markedly different approach from Schema validation in that rather than checking the overall structure of the XML instance, it enables you to specify one or more assertions that we wish to enforce. If all these assertions are met, the document is deemed to be valid.
These assertions are specified using XPath, so it allows us to specify constraints that can't be expressed using XML Schema. For example, following on from the preceding example, we can define the following validations on a credit card.