phax / ph-schematron

Java Schematron library that supports XSLT and native application
Apache License 2.0
116 stars 36 forks source link

Add option to remove conflicting quickfix elements #61

Closed stefan-jung closed 6 years ago

stefan-jung commented 6 years ago

The Schematron Quickfix elements throw several errors. It would be good, if they would be removed in the normalization step.

[schematron] Warning: unrecognized element sqf:fix
phax commented 6 years ago

That is part of the default Schematrons.... Interfering with the output of Saxon and Ant is tricky....

AndrewSales commented 6 years ago

Does passing the parameter [allow-foreign](https://github.com/Schematron/schematron/blob/master/trunk/schematron/code/iso_svrl_for_xslt2.xsl#L188) to the XSLT processor alleviate this?

phax commented 6 years ago

@AndrewSales Thanks a lot - that does the trick.

Code snippet to achieve this directly:

    final SchematronResourceSCH aRes = ...;
    final Map <String, Object> aParams = new HashMap <> ();
    aParams.put ("allow-foreign", "true");
    aRes.setParameters (aParams);
phax commented 6 years ago

Now it got more easy to use:

   final ISchematronXSLTBasedResource aRes = ...;
    aRes.setAllowForeignElements (true);

Usable as of v5.0.2