I have created several Schematron statements and all of them work fine against my XML instances. Nevertheless, I would like to structure the output of my error messages in such a way that later I can process them, for example, using Java.
The output of my approval error message should be
<error>
<errorMessage>My error message</errorMessage>
<violatingElement>The violating element</violatingElement>
</error>
However, a design such as:
<pattern>
<rule context="/p1:Document/p1:Delivery/p1:DeliveryDetails/p1:ShippingDate">
<report test=".">
<error>
<errorMessage>My error message</errorMessage>
<violatingElement>The violating element</violatingElement>
</error>
</report>
</rule>
</pattern>
does not work. What is the correct way to return Schematron to a structured (XML-ified) manner?
source
share