I have created several Schematron assertations and they are all running fine against my XML instances. However, I would like to structure the output of my error messages in such a way, that I later can post-process them, with e.g., Java.
The output of my assertion error message should be
<error>
<errorMessage>My error message</errorMessage>
<violatingElement>The violating element</violatingElement>
</error>
However, a construct 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 of returning Schematron results in a structured (XML-ified) manner?