phax / ph-schematron

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

FailOnError option? #57

Closed rolfkleef closed 6 years ago

rolfkleef commented 6 years ago

I'm one of the Ant fans (still -- not had time to dive into Maven yet).

One thing that would help me: have a failOnError boolean attribute like the Ant XSLT task. Currently, it's possible to expect success or failure with expectSuccess, but I just want to process a collection of files regardless of the result of any single one.

stefan-jung commented 6 years ago

This is definitely a release blocker for org.doctales.schematron, thank you @rolfkleef for requesting this, I thought I already did this before.

phax commented 6 years ago

Present as from SNAPSHOT 42 - https://oss.sonatype.org/content/repositories/snapshots/com/helger/ph-schematron/5.0.0-SNAPSHOT/

stefan-jung commented 6 years ago

Link to jar: https://oss.sonatype.org/content/repositories/snapshots/com/helger/ph-schematron-ant-task/5.0.0-SNAPSHOT/ph-schematron-ant-task-5.0.0-20171102.094211-42-jar-with-dependencies.jar

fviolette commented 6 years ago

@xephon2 Works on my end. Does that cover https://github.com/phax/ph-schematron/issues/50 fully as well for you?

stefan-jung commented 6 years ago

Hey @fviolette, currently the build crashes because of a DITA-OT issue, that I've reported here. So I cannot say, If that covers #50 ATM.

fviolette commented 6 years ago

Oh that... :-) Just running it via ANT looks fine, let's wait for some more debugging then.

rolfkleef commented 6 years ago

Thanks for the speedy update! Unfortunately, it seems to break on my end: no output is produced in the new version.

I've put a small test in https://gist.github.com/rolfkleef/1c8224759e5cc240e956a97ea7cca92e with snapshots 41 and 42: if I change the classpath in the build.xml from version 41 to version 42, the schematron task does not produce output anymore.

ant schematron -d produces debug output that stops at:

...
Class java.lang.invoke.LambdaMetafactory loaded from parent loader (parentFirst)
Class java.util.function.Predicate loaded from parent loader (parentFirst)
[schematron] Schematron processing mode set to 'PURE'
[schematron] Using Schematron file '/home/rolf/dev/sandbox/ph-schematron-ant-task-test/rules.sch'

BUILD SUCCESSFUL
Total time: 0 seconds

Without the schematronProcessingEngine="pure" setting in the Ant task, it ends at the same point, with no output...

phax commented 6 years ago

Thanks for pointing this out. I wasn't capable of creating a reasonable "if" statement :( I used the files from your Gist as a test case. Any objections against incorporating this under Apache 2 license?

rolfkleef commented 6 years ago

Great, works now with snapshot 44!

Maybe replace my own domain with example.com or so in the rules.sch file -- I've basically taken what's on your site under "Known issues", and started trying out which of the Schematron 2016 features are working (properties, role, see don't seem to end up in the SVRL output yet). No problem to include it.

phax commented 6 years ago

The problem was that if a SVRL directory was specified (and valid) the execution simply didn't start; URLs were fixed.

Schematron 2016 support is not really present, as I couldn't find any "change log" - any input???

stefan-jung commented 6 years ago

No, I only know the norm ISO/IEC 19757-3:2016

rolfkleef commented 6 years ago

Same here. There is a bit of information on the new properties on http://schematron.com/an-overview-of-schematron/why-is-schematron-different/

I'm looking into what I really need, I'll open new issues for those.

phax commented 6 years ago

I think http://schematron.com/2016/11/iso-schematron-2016-released/ is a good starting point. I will close this issue and create a new one.