Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Echo all error levels #71

Closed
stefan-jung opened this issue Sep 30, 2018 · 5 comments
Closed

Echo all error levels #71

stefan-jung opened this issue Sep 30, 2018 · 5 comments
Assignees
Milestone

Comments

@stefan-jung
Copy link

Hi,

It seems, that [warning] messages are not echoed. I'm using the engine pure with Apache Ant. I'd expect, that all fatals, errors, warnings and infos are reported as [error].

[schematron] 2 Schematron errors for XML file '/tmp/temp20180930130010635/be423729cc97c0bdf090b1ee78853eaaa7f0c569.dita'
[schematron]   [error] in /topic/title @ /tmp/temp20180930130010635/be423729cc97c0bdf090b1ee78853eaaa7f0c569.dita [image-in-title] Bold formatting in <title> is not allowed.
[schematron]   [error] in /topic/title @ /tmp/temp20180930130010635/be423729cc97c0bdf090b1ee78853eaaa7f0c569.dita [image-in-title] <image> in <title> is not allowed.

-schematron-validate-topics:
[schematron] Validating XML file '/tmp/temp20180930130010635/e7a801267f137d98e591604ff067559ba6637cc8.dita' against Schematron rules from 'termchecker.sch' expecting success
[schematron] XML file '/tmp/temp20180930130010635/e7a801267f137d98e591604ff067559ba6637cc8.dita' was validated against Schematron '/home/stefan/workspace/schematron-presentation/rules/termchecker.sch' and matches the rules - only 1 Schematron warning are contained

Could you please implement that?

Greetings,
Stefan

@phax phax self-assigned this Oct 1, 2018
@phax phax added the ANT task label Oct 1, 2018
@stale
Copy link

stale bot commented May 28, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label May 28, 2019
@phax
Copy link
Owner

phax commented May 28, 2019

@xephon2 I'm closing this in favour of #50 (see my last comment there)

Sorry, the previous comment was crap.
Nevertheless it is fixed in 5.0.11 release.

@phax phax closed this as completed May 28, 2019
@phax phax added this to the v5.1 milestone Jun 11, 2019
@nkutsche
Copy link
Contributor

Hey,

are you sure, this was fixed correctly?

My result for ph-schematron-ant-task-5.0.8-jar-with-dependencies.jar was:

Buildfile: C:\Users\Nico\Desktop\tests\ant\schematron\ph-schematron-usage\build.xml

db.common.validation.schematron:
[schematron] Successfully parsed Schematron file 'C:\Users\Nico\Desktop\tests\ant\schematron\ph-schematron-usage\test.sch'
[schematron] Validating XML file 'C:\Users\Nico\Desktop\tests\ant\schematron\ph-schematron-usage\test.xml' against Schematron rules from 'test.sch' expecting success
[schematron] [main] INFO com.helger.jaxb.JAXBContextCache - Creating JAXB context for package org.oclc.purl.dsdl.svrl using ClassLoader sun.misc.Launcher$AppClassLoader@5c647e05

BUILD FAILED
C:\Users\Nico\Desktop\tests\ant\schematron\ph-schematron-usage\build.xml:19: 1 Schematron error for XML file 'C:\Users\Nico\Desktop\tests\ant\schematron\ph-schematron-usage\test.xml'
  [error] in /foo @ C:\Users\Nico\Desktop\tests\ant\schematron\ph-schematron-usage\test.xml foo should contain bar.

Total time: 2 seconds

With ph-schematron-ant-task-5.1.0-jar-with-dependencies.jar I'm getting now this:

Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre1.8.0_211\lib\tools.jar
Buildfile: C:\Users\Nico\Desktop\tests\ant\schematron\ph-schematron-usage\build.xml

db.common.validation.schematron:
[schematron] Successfully parsed Schematron file 'C:\Users\Nico\Desktop\tests\ant\schematron\ph-schematron-usage\test.sch'
[schematron] Validating XML file 'C:\Users\Nico\Desktop\tests\ant\schematron\ph-schematron-usage\test.xml' against Schematron rules from 'test.sch' expecting success
[schematron] [main] INFO com.helger.jaxb.JAXBContextCache - Creating JAXB context for package org.oclc.purl.dsdl.svrl using ClassLoader sun.misc.Launcher$AppClassLoader@5c647e05

BUILD FAILED
C:\Users\Nico\Desktop\tests\ant\schematron\ph-schematron-usage\build.xml:19: 1 Schematron error for XML file 'C:\Users\Nico\Desktop\tests\ant\schematron\ph-schematron-usage\test.xml'

Total time: 2 seconds

So the log is gone (or only in my case?). Do I have to change something in ant?

Btw, this is my ant script:

<project basedir="." name="ph-schematron test" default="db.common.validation.schematron">
    
    <taskdef name="schematron" classname="com.helger.schematron.ant.Schematron">
        <classpath>
            <fileset dir="lib">
                <include name="*.jar"/>
            </fileset>
        </classpath>
    </taskdef>

    <target name="db.common.validation.schematron">
        <schematron schematronFile="test.sch" expectSuccess="true" failonerror="true">
            <file file="test.xml"/>
        </schematron>
    </target>

</project>

Background infos:

  • Ant version: Apache Ant(TM) version 1.10.6 compiled on May 2 2019
  • Java version: 1.8.0_211
  • System: Windows 10

@phax phax reopened this Jun 12, 2019
@stale stale bot removed the wontfix label Jun 12, 2019
phax added a commit that referenced this issue Jun 12, 2019
@phax
Copy link
Owner

phax commented Jun 12, 2019

You are right - my bad :( 5.1.1 is on it's way.

@phax phax closed this as completed Jun 12, 2019
@nkutsche
Copy link
Contributor

Great, now it works.
Thanks for the really fast reaction!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants