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

Role is not returned when a rule is fired #54

Closed
javajeff opened this issue Oct 20, 2017 · 5 comments
Closed

Role is not returned when a rule is fired #54

javajeff opened this issue Oct 20, 2017 · 5 comments
Assignees
Labels
Milestone

Comments

@javajeff
Copy link

I have created a rule that is fired, but when I get back the FiredRule or the SuccessfulReport, the role value is null.

My rule looks like this:

metadata/description element is missing and is a required field.

I tried putting it in the rule and also in the report, but neither work.

@phax phax self-assigned this Oct 23, 2017
phax added a commit that referenced this issue Oct 23, 2017
@phax phax added the bug label Oct 23, 2017
@phax
Copy link
Owner

phax commented Oct 23, 2017

I had a TODO in the code for "role" handling.
I tried to fix this in the latest SNAPSHOT - can you please check this? Should be on Maven Snapshot repository quiet soon! Thx!

@javajeff
Copy link
Author

Hmm... I built the latest and changed my pom file to reference 5.0.0-SNAPSHOT. When I get back a SuccessfulReport object, the role is still null. Can you send me a rule that has a role that works?

@phax
Copy link
Owner

phax commented Oct 25, 2017

The problem is - I don't have an example. Can you please send me yours - I of course handle it confidentially.

phax added a commit that referenced this issue Oct 30, 2017
@phax
Copy link
Owner

phax commented Oct 30, 2017

See the example file in the above commit.
The output looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<schematron-output xmlns="http://purl.oclc.org/dsdl/svrl" title="" schemaVersion="">
  <active-pattern id="sampleValidation" name="sampleValidation" document="" />
  <fired-rule context="CCC" role="abc" />
  <fired-rule context="CCC" role="abc" />
  <failed-assert location="/simple[1]/CCC[2]" test="A and B">
    <text>A and B must be present</text>
  </failed-assert>
  <fired-rule context="CCC" role="abc" />
  <failed-assert location="/simple[1]/CCC[3]" test="A and B">
    <text>A and B must be present</text>
  </failed-assert>
</schematron-output>

it is located in the Schematron like this:

    <sch:rule context="CCC" role="abc">
      <sch:assert test="A and B">A and B must be present</sch:assert>
    </sch:rule>

When using the "pure" version for parsing, you need to wait for v5.0.0 for it to work. When using the regular Schematron/XSLT approach, this should also work for v4.x. hth

@javajeff
Copy link
Author

javajeff commented Oct 31, 2017 via email

@phax phax added this to the v5.0.0 milestone Nov 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants