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

Rule is fired even if context was matched by a previous rule #84

Open
dmj opened this issue Aug 6, 2019 · 1 comment
Open

Rule is fired even if context was matched by a previous rule #84

dmj opened this issue Aug 6, 2019 · 1 comment

Comments

@dmj
Copy link

dmj commented Aug 6, 2019

Using the following Schematron:

<sch:schema>
  <sch:pattern>
    <sch:rule context="element">
      <sch:assert test="true()"/>
    </sch:rule>
    <sch:rule context="*">
      <sch:assert test="false()"/>
    </sch:rule>
  </sch:pattern>
</sch:schema>

And the following document:

<?pi Processing instruction ?>
<element attribute="value">
  <!-- Comment -->
  <element>Text content</element>
</element>

I expect the second rule not to fire. But it does:

<?xml version="1.0" encoding="UTF-8"?>
<schematron-output xmlns="http://purl.oclc.org/dsdl/svrl">
  <active-pattern/>
  <fired-rule context="//element"/>
  <fired-rule context="//*"/>
  <failed-assert location="/element" test="false()">
    <text/>
  </failed-assert>
  <failed-assert location="/element/element" test="false()">
    <text/>
  </failed-assert>
</schematron-output>

This was discovered with running ph-schematron 5.2.0 against a in-progress schematron testsuite. The complete test results are shown here.

@phax phax self-assigned this Aug 6, 2019
@phax phax added the bug label Aug 6, 2019
@stale
Copy link

stale bot commented Nov 4, 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.

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

2 participants