How do I return Schematron validation results in a structured manner

前端 未结 3 1611
执念已碎
执念已碎 2021-01-14 09:48

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

相关标签:
3条回答
  • 2021-01-14 10:01

    You can also leverage a native schematron engine, rather than an XSL stylesheet, to deteremine whether the assertions are satisfied. I'm working with one for .NET / C# here.

    0 讨论(0)
  • 2021-01-14 10:07

    Schematron by design wants to keep the content of assertions and reports as natural language only. The Standard (available here) encourages the use of the diagnostics element for richer information. It states:

    The natural-language assertion may contain information about actual values in addition to expected values and may contain diagnostic information. Users should note, however, that the diagnostic element is provided for such information to encourage clear statement of the natural-language assertion.

    diagnostic messages are contained in <diagonstic> elements (wrapped in a <diagnostics> wrapper) and associated with reports and assertions using an ID/IDREF mechanism.

    There is an example showing the use of diagnostics in Annex G of the Standard.

    0 讨论(0)
  • 2021-01-14 10:12

    Actually to get a Schematron report as XML you should use SVRL. You can learn more about it here: Schematron Validation Report Language (SVRL)

    The big advantage of using SVRL is that you can also get detailed information about where the assertion/report was triggered as an XPath.

    0 讨论(0)
提交回复
热议问题