itplr-kosit / validator

Validates XML documents with XML Schema and Schematron
Apache License 2.0
80 stars 42 forks source link

Custom Level ignored in Result via Java Api #127

Open JannickWeisshaupt opened 9 months ago

JannickWeisshaupt commented 9 months ago

Custom Levels for asserts in the scenario file, e.g.

<customLevel level="warning">BR-CL-23</customLevel>

are ignored in the de.kosit.validationtool.api.Result object, when accessed e.g. as

    for (SchematronOutput output : result.getSchematronResult())
    {
      for (FailedAssert failedAssert : output.getFailedAsserts())
      {
        String flag = failedAssert.getFlag();
        validationErrors.addAll(failedAssert.getText().getContent().stream()
            .filter(x -> x instanceof String)
            .map(x -> (String) x)
            .map(x -> x + " (Level: " + flag + ")")
            .collect(toList()));
      }
    }

BR-CL-23 would be listed as fatal here.

fbuettner-hb commented 9 months ago

@JannickWeisshaupt I ran into a problem that might be related, see #129.