Domanda

I've got an XSD schema with various embedded Schematron rules. I've also got an XML that is supposed to be valid but it isn't, so I need to fix the rules.

How can I efficiently debug how each assertion is evaluated?

(I'm currently using Oxygen but any tool that does the job is good for me.)

È stato utile?

Soluzione

usually Schematron is validated using the standard implementation as XSLT stylesheets. This means the actual validation is to apply a final stylesheet which is generated (in several steps) from the Schematron schema. If you have the stylesheet which is applied to validate the instance document you could run it through any XSLT debugger. The only tool I'm aware of that lets you save the validation stylesheet as a separate file for you is XML ValidatorBuddy . Maybe this helps

(Note: copied from Comment as Answer on request)

Altri suggerimenti

You can also use step-by-step debugging within a native schematron engine. You haven't mentioned your development stack, but when I want to do what you're talking about, I run my schematron engine in a debugger and use breakpoints to inspect the state of things for the rule/pattern/assertion in question -- what is being provided for the context node? what does the assertion xpath return in the watch window? etc... etc...

Here's a C# schematron engine.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top