How do I return Schematron validation results in a structured manner

橙三吉。 提交于 2019-12-01 09:42:04

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.

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.

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.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!