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

"Show" doesn't always work correctly for Schematron x:expect-* elements #55

Open
galtm opened this issue Apr 16, 2024 · 1 comment
Open

Comments

@galtm
Copy link
Member

galtm commented Apr 16, 2024

How to reproduce the problem in Oxygen 26.1:

  1. Open an XSpec test for a Schematron schema in which a scenario contains <x:expect-valid> and <x:expect-assert>.
  2. Duplicate the <x:expect-assert>, including all its attributes, in the same XSpec file. For instance, copy the element and paste it into another scenario.
  3. Click Run XSpec test scenarios to run the test.
  4. In the XSpec Test Results window, click Show next to the listing for valid. The <x:expect-valid> element should be selected, but it isn't.
  5. Click Show next to each of the <x:expect-assert> elements. They both select the first instance of this element in the XSpec file, instead of selecting the corresponding instance.

The issue with <x:expect-assert> seems to affect <x:expect-report>, <x:expect-not-assert>, <x:expect-not-report>, and <x:expect-rule> as well.

Sample XSpec scenarios, just to make it concrete

  <x:scenario label="Scenario 1">
    <x:context>
      <foo/>
    </x:context>
    <x:expect-not-assert id="abc"/>
    <x:expect-not-report/>
    <x:expect-valid/>
  </x:scenario>
  <x:scenario label="Scenario 2">
    <x:context>
      <bar/>
    </x:context>
    <x:expect-not-report/>
    <x:expect-not-assert id="abc"/>
  </x:scenario>

(Perhaps everything fails in the example above, depending on your schema, but I don't think the pass/fail status affects the "Show" behavior I'm seeing.)

@galtm
Copy link
Member Author

galtm commented Apr 16, 2024

At first, I thought this issue was Schematron-specific and did not affect <x:expect> in a test for XSLT or XQuery. I changed my mind. In the sample code below in a test for XSLT or XQuery, the duplicate scenario labels (in addition to duplicate <x:expect> elements) seem relevant.

  <x:scenario label="Top-level scenario 1">
    <x:scenario label="fcn with no parameters">
      <x:call function="true"/>
      <x:expect label="passes" test="1 gt 0"/>
      <x:expect label="fails" test="1 eq 2"/>
    </x:scenario>
  </x:scenario>
  <x:scenario label="Top-level scenario 2">
    <x:scenario label="fcn with no parameters">
      <x:call function="false"/>
      <x:expect label="fails" test="1 eq 2"/>
      <x:expect label="passes" test="1 gt 0"/>
    </x:scenario>
  </x:scenario>

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

No branches or pull requests

1 participant